1 # read-pkg [![Build Status](https://travis-ci.org/sindresorhus/read-pkg.svg?branch=master)](https://travis-ci.org/sindresorhus/read-pkg)
3 > Read a package.json file
8 - [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs)
9 - [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom)
10 - [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json)
11 - [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails)
17 $ npm install --save read-pkg
24 var readPkg = require('read-pkg');
26 readPkg().then(function (pkg) {
28 //=> {name: 'read-pkg', ...}
31 readPkg(__dirname).then(function (pkg) {
33 //=> {name: 'read-pkg', ...}
36 readPkg(path.join('unicorn', 'package.json')).then(function (pkg) {
38 //=> {name: 'read-pkg', ...}
45 ### readPkg([path], [options])
47 Returns a promise that resolves to the parsed JSON.
49 ### readPkg.sync([path], [options])
51 Returns the parsed JSON.
58 Path to a `package.json` file or its directory.
67 [Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.
72 - [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file
73 - [write-pkg](https://github.com/sindresorhus/write-pkg) - Write a `package.json` file
74 - [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file
79 MIT © [Sindre Sorhus](http://sindresorhus.com)