selfupdate
Selfupdate your global NPM package.
Installation
Install selfupdate
by running:
$ npm install --save selfupdate
Documentation
selfupdate.update(Object packageJSON, Function callback)
Update a globally installed NPM package.
If the installation fails with a permission related error, the module will attempt to elevate privileges automatically.
The function requires the package.json
, which you can require like:
var packageJSON = ;
The callback gets passed two arguments: (error, version)
, where version
is the new version of the package after the update took place.
Example:
var selfupdate = ;var packageJSON = ; selfupdate;
selfupdate.isUpdated(Object packageJSON, Function callback)
Check if a global package is in the latest version.
The function requires the package.json
, which you can require like:
var packageJSON = ;
The callback gets passed two arguments: (error, isUpdated)
, where isUpdated
is a Boolean
that determines if the package is up to date.
Example:
var selfupdate = ;var packageJSON = ; selfupdate;
Tests
Run the test suite by doing:
$ gulp test
Contribute
- Issue Tracker: github.com/jviotti/selfupdate/issues
- Source Code: github.com/jviotti/selfupdate
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lint
Support
If you're having any problem, please raise an issue on GitHub.
ChangeLog
v1.1.0
- [feature] Expose selfupdate.isUpdated()
License
The project is licensed under the MIT license.