etcher-latest-version
Utility to determine which is the latest published Etcher version
Installation
Install etcher-latest-version
by running:
$ npm install --save etcher-latest-version
Documentation
module.exports(request, callback) ⏏
In order to make this function easily usable in both NodeJS and the browser, we decouple the latest version finder logic from the function that performs the HTTP GET request to the bucket URL.
You should pass a request
function that takes two parameters: the url
and
a callback
, and should call the latter with result of making an HTTP GET
request to the passed URL.
For example, if you're using Angular, the request function will look something like this:
const request = (url, callback) => {
$http.get(url).then((response) => {
return callback(null, response.data);
}).catch((error) => {
return callback(error);
});
};
Kind: Exported function
Summary: Get Etcher latest version
Access: public
Param | Type | Description |
---|---|---|
request | function |
HTTP GET request function |
callback | function |
callback (error, latestVersion) |
Example
const request = ;const etcherLatestVersion = ; ;
Support
If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.
Tests
Run the test suite by doing:
$ npm test
Contribute
- Issue Tracker: github.com/resin-io-modules/etcher-latest-version/issues
- Source Code: github.com/resin-io-modules/etcher-latest-version
Before submitting a PR, please make sure that you include tests, and that jshint runs without any warning:
$ npm run lint
License
The project is licensed under the Apache 2.0 license.