We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
existsSync
1 parent 14b9436 commit 1541388Copy full SHA for 1541388
lib/get-package-json.js
@@ -12,14 +12,16 @@ function findPackageDir(paths) {
12
for (var i = 0; i < paths.length; ++i) {
13
var dir = pather.dirname(paths[i]);
14
var dirName = dir.split(pather.sep).pop();
15
- if (dirName !== packageName && fs.existsSync(pather.join(dir, 'package.json'))) {
+ if (dirName !== packageName) {
16
return dir;
17
}
18
19
20
/**
21
+ * find package.json directory and return package json.
22
+ * You should pass `module.paths` to `paths`.
23
* @param {string[]} paths the paths for look-up
- * @returns {*}
24
+ * @returns {object}
25
*/
26
function getPackageJSON(paths) {
27
var dir = findPackageDir(paths);
0 commit comments