jack e1a2621c78 update | 2 gadi atpakaļ | |
---|---|---|
.. | ||
index.js | 2 gadi atpakaļ | |
license | 2 gadi atpakaļ | |
package.json | 2 gadi atpakaļ | |
readme.md | 2 gadi atpakaļ |
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