$ cnpm install read-pkg
Read a package.json file
$ npm install read-pkg
import {readPackageAsync} from 'read-pkg';
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
fileCopyright 2013 - present © cnpmjs.org