summaryrefslogtreecommitdiffstats
path: root/node_modules/pkg-dir/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/pkg-dir/index.js')
-rw-r--r--node_modules/pkg-dir/index.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/node_modules/pkg-dir/index.js b/node_modules/pkg-dir/index.js
new file mode 100644
index 0000000..f2fa201
--- /dev/null
+++ b/node_modules/pkg-dir/index.js
@@ -0,0 +1,10 @@
+'use strict';
+const path = require('path');
+const findUp = require('find-up');
+
+module.exports = cwd => findUp('package.json', {cwd}).then(fp => fp ? path.dirname(fp) : null);
+
+module.exports.sync = cwd => {
+ const fp = findUp.sync('package.json', {cwd});
+ return fp ? path.dirname(fp) : null;
+};