node-vers

1.2.0 • Public • Published

Node Vers

Gives a listing of all Node versions

Usage:

You can use node-vers as a module or a CLI utility.

Using as a module:

var nodevers = require('node-vers');
 
nodevers.list(null, function(err, result) {
  if (err) {
    console.error("Error occurred: " + err);
  } else {
    console.log(result);
  }
});

You can also exclude certain fields from the resulting JSON, if you don't need them:

var options = { "blacklist" : ["files", "openssl", "modules", "uv", "zlib"] };
nodevers.list(options, function(err, result) {
    console.log(result);
});

And you can indicate to only get single (latest) value for each minor version:

var options = { "latest_only" : true 
              , "blacklist" : ["files", "openssl", "modules", "uv", "zlib"] };
nodevers.list(options, function(err, result) {
    console.log(result);
});

Using as a CLI utility

> npm install -g node-vers
> node-vers

Alternatives:

Differences:

  1. NV caches static list of node versions and you need to run an update script if you want to get the latest list. Node-vers does a live lookup every time.

  2. NV grabs the list of versions by looking at the list of tags in Node's github repo. This is pretty cool, but it means: git must be installed wherever you want to use this module + you may get something weird if somebody over at Node accidentally creates a stray git tag.

  3. NV only returns the list of versions, while Node-Vers returns an object, for each version, containing following kind of metadata:

    {   version: 'v5.6.0',
        date: '2016-02-09',
        files: 'headers,linux-arm64,linux-armv6l,linux-armv7l,linux-x64,linux-x86,osx-x64-pkg,osx-x64-tar,src,sunos-x64,sunos-x86,win-x64-msi,win-x86-msi',
        npm: '3.6.0',
        v8: '4.6.85.31',
        uv: '1.8.0',
        zlib: '1.2.8',
        openssl: '1.0.2f',
        modules: '47' }
    
  4. NV supports both Node.js and IO.js. Since IO.js was merged back into Node, I had no interest in supporting io.js

Readme

Keywords

none

Package Sidebar

Install

npm i node-vers

Weekly Downloads

0

Version

1.2.0

License

MIT

Last publish

Collaborators

  • irakli