aswi2020vldc-gitlab/templetes/node_modules/pkg-dir/index.js @ 0b434236
1 | 3a515b92 | cagy | '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 | };
|