chensenlai 10988628a0 语音房项目初始化 | 5 gadi atpakaļ | |
---|---|---|
.. | ||
index.js | 5 gadi atpakaļ | |
license | 5 gadi atpakaļ | |
package.json | 5 gadi atpakaļ | |
readme.md | 5 gadi atpakaļ |
Read a package.json file
$ npm install --save read-pkg
var readPkg = require('read-pkg');
readPkg().then(function (pkg) {
console.log(pkg);
//=> {name: 'read-pkg', ...}
});
readPkg(__dirname).then(function (pkg) {
console.log(pkg);
//=> {name: 'read-pkg', ...}
});
readPkg(path.join('unicorn', 'package.json')).then(function (pkg) {
console.log(pkg);
//=> {name: 'read-pkg', ...}
});
Returns a promise that resolves to the parsed JSON.
Returns the parsed JSON.
Type: string
Default: .
Path to a package.json
file or its directory.
Type: boolean
Default: true
Normalize the package data.
package.json
fileMIT © Sindre Sorhus