aswi2020vldc-gitlab/templetes/node_modules/pkg-dir/index.js @ 9bb1e829
1 |
'use strict'; |
---|---|
2 |
const path = require('path'); |
3 |
const findUp = require('find-up'); |
4 |
|
5 |
module.exports = cwd => findUp('package.json', {cwd}).then(fp => fp ? path.dirname(fp) : null); |
6 |
|
7 |
module.exports.sync = cwd => { |
8 |
const fp = findUp.sync('package.json', {cwd}); |
9 |
return fp ? path.dirname(fp) : null; |
10 |
};
|