npm-vers

Retrieve all versions from a module with helper to get the latestRelease and latestPreRelease

npm-vers

Retrieve all versions from a module with helper to get the latestRelease and latestPreRelease

Install the module with: npm install npm-vers

var npmVersions = require('npm-vers');
npmVersions('npmi', function (errresult) {
  if (err) {
    throw err;
  }
  
  console.log(result);
});

#### 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

For instance:
['0.0.0', '0.0.1-SNAPSHOT', '0.0.1', '0.0.2-alpha']
Will result in:

var npmVersions = require('npm-vers');
npmVersions('foo', function (errresult) {
  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 
});

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.

0.1.0 - 18/06/2014

Copyright (c) 2014 Maxime Tricoire. Licensed under the MIT license.