|
3 лет назад | |
---|---|---|
.. | ||
node_modules | 3 лет назад | |
index.d.ts | 3 лет назад | |
index.js | 3 лет назад | |
license | 3 лет назад | |
package.json | 3 лет назад | |
readme.md | 3 лет назад |
Find the closest package.json file
$ npm install pkg-up
/
└── Users
└── sindresorhus
└── foo
├── package.json
└── bar
├── baz
└── example.js
// example.js
const pkgUp = require('pkg-up');
(async () => {
console.log(await pkgUp());
//=> '/Users/sindresorhus/foo/package.json'
})();
Returns a Promise<string>
for the filepath, or Promise<null>
if it couldn't be found.
Returns the filepath, or null
if it couldn't be found.
Type: Object
Type: string
Default: process.cwd()
Directory to start from.
MIT © Sindre Sorhus