read-pkg
Read a package.json file
Last updated 3 months ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install read-pkg 
SYNC missed versions from official npm registry.

read-pkg Build Status

Read a package.json file

Why

Install

$ npm install read-pkg

Usage

const readPkg = require('read-pkg');

(async () => {
	console.log(await readPkg());
	//=> {name: 'read-pkg', …}

	console.log(await readPkg({cwd: 'some-other-directory'}));
	//=> {name: 'unicorn', …}
})();

API

readPkg(options?)

Returns a Promise<object> with the parsed JSON.

readPkg.sync(options?)

Returns the parsed JSON.

options

Type: object

cwd

Type: string
Default: process.cwd()

Current working directory.

normalize

Type: boolean
Default: true

Normalize the package data.

Related


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Current Tags

  • 5.2.0                                ...           latest (3 months ago)

10 Versions

  • 5.2.0                                ...           3 months ago
  • 5.1.1                                ...           6 months ago
  • 5.1.0                                ...           6 months ago
  • 5.0.0                                ...           7 months ago
  • 4.0.1                                ...           a year ago
  • 4.0.0                                ...           a year ago
  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           3 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 28,675
This Week 74,769
This Month 648,584
Last Day 46,094
Last Week 250,190
Last Month 1,024,949
Dependencies (4)
Dev Dependencies (3)
Dependents (508)

Copyright 2014 - 2016 © taobao.org |