{"name":"read-pkg","version":"4.0.0","description":"Read a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/read-pkg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","read","parse","file","fs","graceful","load","pkg","package","normalize"],"dependencies":{"normalize-package-data":"^2.3.2","parse-json":"^4.0.0","util.promisify":"^1.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"8f30e19a5359111660e65d428d571ec4340814ae","bugs":{"url":"https://github.com/sindresorhus/read-pkg/issues"},"homepage":"https://github.com/sindresorhus/read-pkg#readme","_id":"read-pkg@4.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-2avHM2nMA5tFOMEDkB+VgMHzfRlv9d5GNc3RMTxFoOyoRN50RnLz6oN6QPiTZRYbqrufJBa/9GzWEYas0uvZZw==","shasum":"ee3801906504d73af4c9630ab1cd0cea8232e5c2","tarball":"http://registry-npm.ywwl.com/read-pkg/download/read-pkg-4.0.0.tgz","fileCount":4,"unpackedSize":4155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMRMGCRA9TVsSAnZWagAAHtIQAIp1T/NY304OXGL7dkoK\nVTu4E0p9S7H+NytTph01izyA799Ya2Q2hl5+Zq+SoDhqyfbNBeMCrvDMtXWM\nRNP4rluFEGYTU0V/9JzCz8KbhuK11VAPzCjVlVOtcaQXhMsSL+MGU2dFKgxz\nvlmbZDt9W22ffO/uijUtuWILpnJmWjrrIFpiv685E9zH3WvOQTz+YCAQPxTR\nIQV5E2fMdHu0ecCt1BzojsRdHpIeIz8uJAzLvGmrbdnWWwA73OyQZCgdKanm\njUf+m1vtQU253ent/vSU5RikzmDyJR+1OW9XvLvxfwTxBtml2Gtbl3HtPZtV\nGq8MCRNsX5o4MyqUHaCim+3RR3Cj1NXCZDmS2DchbgP/sWOpdFToBocV4YMj\nyxSCjkxZcBRk+UYt9kdG88VzAeHXHDqkYr5+jWlsGtgCTqOakSr1uHvLb1HE\npWfXTQzQrpfw0UqhRonOEx393+zhkM4i0xqDB9i8gOkteVaUKbABYx6IehmS\nsmMwK+jtKBB9fIa+/72Gmer0QPjSk+w0bm8ygSz8D9vGb+GWWo4o/qq8B+DN\n9R+32Kt6o3CSFKfgO5w+bDPnS8w8fHajAyF6lqtY5r25vmXL+Z4up0tDQKGE\ny2v9balu4JV94Ihbl7meCVsz9z06fnAo1qm3dnSGQjFuRNHd9D8b9YpfVVBY\nubFk\r\n=tfth\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjav2dpiaFmPQvtl+v48qoqfYQhtVq2q+J1dghqgYUFQIhAI43a3py80MfXhNy0zt/N898IiV690F/jNnnXX94d9Jm"}],"size":1987,"noattachment":false,"key":"/read-pkg/-/read-pkg-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-pkg_4.0.0_1529942790299_0.382594879990501"},"_hasShrinkwrap":false,"readme":"# read-pkg\n\n> Read a package.json file\n\n## Why\n\n- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json)\n- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails)\n\n## Install\n\n```sh\nnpm install read-pkg\n```\n\n## Usage\n\n```js\nimport {readPackage} from 'read-pkg';\n\nconsole.log(await readPackage());\n//=> {name: 'read-pkg', …}\n\nconsole.log(await readPackage({cwd: 'some-other-directory'}));\n//=> {name: 'unicorn', …}\n```\n\n## API\n\n### readPackage(options?)\n\nReturns a `Promise<object>` with the parsed JSON.\n\n### readPackageSync(options?)\n\nReturns the parsed JSON.\n\n#### options\n\nType: `object`\n\n##### cwd\n\nType: `URL | string`\\\nDefault: `process.cwd()`\n\nCurrent working directory.\n\n##### normalize\n\nType: `boolean`\\\nDefault: `true`\n\n[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.\n\n### parsePackage(packageFile, options?)\n\nParses an object or string into JSON.\n\n#### packageFile\n\nType: `object | string`\n\nAn object or a stringified object to be parsed as a package.json.\n\n#### options\n\nType: `object`\n\n##### normalize\n\nType: `boolean`\\\nDefault: `true`\n\n[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.\n\n## Related\n\n- [read-package-up](https://github.com/sindresorhus/read-package-up) - Read the closest package.json file\n- [write-package](https://github.com/sindresorhus/write-package) - Write a `package.json` file\n- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file\n","publish_time":1529942790381,"_cnpm_publish_time":1529942790381,"dist-tags":{"latest":"10.1.0"}}