jack e1a2621c78 update | 2 years ago | |
---|---|---|
.. | ||
index.js | 2 years ago | |
license | 2 years ago | |
package.json | 2 years ago | |
readme.md | 2 years ago |
Find the closest package.json file
$ npm install --save pkg-up
/
└── Users
└── sindresorhus
└── foo
├── package.json
└── bar
├── baz
└── example.js
// example.js
var pkgUp = require('pkg-up');
pkgUp().then(function (filepath) {
console.log(filepath);
//=> '/Users/sindresorhus/foo/package.json'
});
Returns a promise that resolves to a filepath or null
.
Returns a filepath or null
.
Type: string
Default: '.'
Directory to start from.
MIT © Sindre Sorhus