1.0.1 • Published 10 years ago

package-write v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

#package-write

CLI and module for easily writing / updating a package.json file

Install

npm i -g package-write

Usage

CLI

package-write "scripts.prepush" "jshint . && npm test"

Will result in

"scripts": {
    "prepush": "jshint . && npm test"
}

Module

var packageWrite = require('packageWrite'),
    fs = require('fs'),
    packagePath = packageWrite.getPackagePath(),
    packageFile = packageWrite.getPackage(packagePath);

packageWrite.applyChange(packageFile, 'scripts.prepush', 'jshint . && npm test');

fs.writeFileSync(packagePath, JSON.stringify(packageFile, null, 2));

Will result in

"scripts": {
    "prepush": "jshint . && npm test"
}
1.0.1

10 years ago

1.0.0

10 years ago