write-pkg
Write a
package.json
file
Writes atomically and creates directories for you as needed. Sorts dependencies when writing.
Install
$ npm install --save write-pkg
Usage
const path = ;const writePkg = ; ; ; ;
API
writePkg([path], data)
Returns a Promise
.
writePkg.sync([path], data)
path
Type: string
Default: process.cwd()
Path to where the package.json
file should be written or its directory.
Related
- read-pkg - Read a
package.json
file - write-json-file - Stringify and write JSON to a file atomically
License
MIT © Sindre Sorhus