0.0.1 • Published 10 years ago

packagefile-editor v0.0.1

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

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 = require('packagefile-editor');

var package = new Editor();

package.addDependencies(['express']);
package.addDevDependencies(['mocha']);

package.writeFile();

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.addDependencies(['express', 'mongoose@3.9.0]);

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.writeFile();

Licence

Copyright (c) 2014 FallenRiteMonk Licensed under the MIT license.

0.0.1

10 years ago