package.json File Editor
An API to add Dependencies to a package.json
file without installing them.
Installation
npm install packagefile-editor --save
Example
var Editor = ; var package = ; package;package; package;
API
new PackagefileEditor( content )
Constructor, creates a new editor instance. Predefined package.json
file content can be passed in, else an empty content set will be used.
editor.addDependencies( dependencies )
Add dependencies to the package.json
file. Version or tag of the dependency can be added as on npm install.
editor
editor.addDevDependencies( devDependencies )
Same as addDependencies, only adds devDependencies.
editor.writeFile( name )
Writes the new package.json
file. An optional name can be passed in.
editor;
Licence
Copyright (c) 2014 FallenRiteMonk Licensed under the MIT license.