https://github.com/toddtreece/autoupdater
Make npm modules auto-update themselves
https://github.com/toddtreece/autoupdater
Last synced: about 1 year ago
JSON representation
Make npm modules auto-update themselves
- Host: GitHub
- URL: https://github.com/toddtreece/autoupdater
- Owner: toddtreece
- License: other
- Created: 2016-06-07T17:04:27.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-07T21:03:11.000Z (about 10 years ago)
- Last Synced: 2025-03-09T05:05:40.297Z (over 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: License.md
Awesome Lists containing this project
README
# autoupdater
Make your CLI npm modules auto-update themselves.
### Installation
Requires the latest stable version of Node.js. v6.x or higher.
```
$ npm install cli-autoupdate --save
```
### Features
- Uses battle-tested [update-notifier](https://npmjs.org/package/update-notifier)
- Installs new versions in the background
- Emits `update` event to notify you of the start of an update
- Emits `finish` event to notify you of the completion of the update (or if no update is needed)
### Usage
```js
const AutoUpdate = require('cli-autoupdate');
// load package.json of the package you wish to update
let pkg = require('path/to/package.json');
const update = new AutoUpdate(pkg);
update.on('update', () => console.log('started update'));
update.on('finish', () => console.log('finished updating'));
```
### License
MIT © [Vadym Demedes](http://vadimdemedes.com)
Modified Work © [Todd Treece](https://uniontownlabs.org)