Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxleiko/npm-vers
Retrieve all versions from a module with helper to get the latestRelease and latestPreRelease
https://github.com/maxleiko/npm-vers
Last synced: 7 days ago
JSON representation
Retrieve all versions from a module with helper to get the latestRelease and latestPreRelease
- Host: GitHub
- URL: https://github.com/maxleiko/npm-vers
- Owner: maxleiko
- License: mit
- Created: 2014-06-18T11:36:13.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-28T17:01:30.000Z (about 10 years ago)
- Last Synced: 2024-10-29T06:06:36.528Z (19 days ago)
- Language: JavaScript
- Size: 180 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# npm-vers [![Build Status](https://secure.travis-ci.org/maxleiko/npm-vers.png?branch=master)](http://travis-ci.org/maxleiko/npm-vers)
Retrieve all versions from a module with helper to get the latestRelease and latestPreRelease
## Getting Started
Install the module with: `npm install npm-vers````javascript
var npmVersions = require('npm-vers');
npmVersions('npmi', function (err, result) {
if (err) {
throw err;
}
console.log(result);
});
```## Documentation
#### result.current
__Type:__ SemVer object
__Content:__ current version (latest) on `registry.npmjs.org`#### result.versions
__Type:__ Array
__Content:__ current version (latest) on `registry.npmjs.org`#### result.latestRelease
__Type:__ SemVer object (or null)
__Content:__ latest clean `release` version on `registry.npmjs.org`#### result.latestPreRelease
__Type:__ SemVer object (or null)
__Content:__ latest `prerelease` or `build` version on `registry.npmjs.org`## Examples
For instance:
['0.0.0', '0.0.1-SNAPSHOT', '0.0.1', '0.0.2-alpha']
Will result in:
```js
var npmVersions = require('npm-vers');
npmVersions('foo', function (err, result) {
if (err) {
throw err;
}
// result.current = 0.0.2-alpha
// result.versions = ['0.0.0', '0.0.1-SNAPSHOT', '0.0.1', '0.0.2-alpha']
// result.latestRelease = 0.0.1
// result.latestPreRelease = 0.0.2-alpha
});
```## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).## Release History
0.1.0 - 18/06/2014## License
Copyright (c) 2014 Maxime Tricoire. Licensed under the MIT license.