Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

read-pkg

Package Overview
Dependencies
4
Maintainers
1
Versions
13
Issues
File Explorer

Advanced tools

read-pkg

Read a package.json file

    7.1.0latest

Version published
Maintainers
1
Weekly downloads
34,899,155
decreased by-11.52%

Weekly downloads

Changelog

Source

  • Accept URL as cwd (#27) b496fe7

https://github.com/sindresorhus/read-pkg/compare/v7.0.0...v7.1.0

Readme

Source

read-pkg

Read a package.json file

Why

  • Throws more helpful JSON errors
  • Normalizes the data

Install

$ npm install read-pkg

Usage

import {readPackage} from 'read-pkg'; console.log(await readPackage()); //=> {name: 'read-pkg', …} console.log(await readPackage({cwd: 'some-other-directory'})); //=> {name: 'unicorn', …}

API

readPackage(options?)

Returns a Promise<object> with the parsed JSON.

readPackageSync(options?)

Returns the parsed JSON.

options

Type: object

cwd

Type: URL | string
Default: process.cwd()

Current working directory.

normalize

Type: boolean
Default: true

Normalize the package data.


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.

Keywords

FAQs

What is read-pkg?

Read a package.json file

Is read-pkg popular?

The npm package read-pkg receives a total of 27,874,386 weekly downloads. As such, read-pkg popularity was classified as popular.

Is read-pkg well maintained?

We found that read-pkg demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 08 Feb 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc