Reads package.json in the working directory.
$ yarn add read-package
.
├── foo
│ └── ...
└── bar
└── package.json
const readPackage = require('read-package')
readPackage('foo')
//=> package.json not found in the current project.
readPackage('bar')
//=> { "name": "fixture", "version": "1.0.0" }Returns an object or throws an error.
Type: string
Default: process.cwd()
Current working directory.
- has-package — Check if a project has package.json
MIT © Bu Kinoshita