Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

package-json-io

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

package-json-io

Read and update package.json files

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5K
decreased by-9.59%
Maintainers
1
Weekly downloads
 
Created
Source

package-json-io

Read and update package.json files.

Build status js-standard-style

Installation

npm install package-json-io

Usage

var pkg = require('package-json-io')

// read and parse the package.json file in current directory
pkg.read(function (err, data) {
  data.license = 'MIT'

  // update the package.json file in the current directory with a new license
  pkg.update(data, function (err) {
    if (err) throw err
  })
})

API

read([file], callback)

Will read the package.json file in the current working directory unless the optinal file argument specifies another file.

Will call the callback with an optinal error argument and the data from the parsed package.json file.

update([file], data, callback)

Will replace the package.json file in the current working directory (unless the optinal file argument specifies another file) with the provided data object.

Will call the callback when done with an optional error argument.

License

MIT

Keywords

FAQs

Package last updated on 13 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc