Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shakyshane/update-checker
Check the NPM registry for package updates
https://github.com/shakyshane/update-checker
Last synced: about 1 month ago
JSON representation
Check the NPM registry for package updates
- Host: GitHub
- URL: https://github.com/shakyshane/update-checker
- Owner: shakyShane
- License: mit
- Created: 2014-02-03T19:43:26.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-14T10:27:40.000Z (almost 11 years ago)
- Last Synced: 2024-10-29T03:49:47.454Z (2 months ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# update-checker [![Build Status](https://travis-ci.org/shakyShane/update-checker.png?branch=master)](https://travis-ci.org/shakyShane/update-checker)
Check if there's an update available for a package on NPM.
## Install
`npm install update-checker`##API
**updateChecker.checkForUpdate(packageName, installedVersion)**##Example
```javascript
var updateChecker = require("update-checker");
var pkgJson = require("package.json");updateChecker.checkForUpdate("browser-sync", pkgJson.version).then(function (newer) {
if (newer) {
// There's a newer version available
// Prompt your users to upgrade.
} else {
// Package is up-to-date
}
}).fail(function (errorMsg) {
console.log(errorMsg);
});
```## License
Copyright (c) 2013 Shane Osbourne
Licensed under the MIT license.