Get node_modules in order

This commit is contained in:
Timothy Clem
2019-09-23 20:01:12 -07:00
parent 907eb9b682
commit 343ceb1920
7410 changed files with 1868249 additions and 0 deletions

View File

@@ -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;
};