peach a19a732be8 commit message | 2 лет назад | |
---|---|---|
.. | ||
node_modules | 2 лет назад | |
index.d.ts | 2 лет назад | |
index.js | 2 лет назад | |
license | 2 лет назад | |
package.json | 2 лет назад | |
readme.md | 2 лет назад |
Read a package.json file
$ npm install read-pkg
const readPkg = require('read-pkg');
(async () => {
console.log(await readPkg());
//=> {name: 'read-pkg', …}
console.log(await readPkg({cwd: 'some-other-directory'}));
//=> {name: 'unicorn', …}
})();
Returns a Promise<object>
with the parsed JSON.
Returns the parsed JSON.
Type: object
Type: string
Default: process.cwd()
Current working directory.
Type: boolean
Default: true
Normalize the package data.
package.json
file