version

NodeJS package.json version number fetcher

npm install version
92 downloads in the last day
191 downloads in the last week
467 downloads in the last month

version

Node.js package.json version number fetcher

Build Status

Installation

$ npm install version

Example (basic)

var version = require('version');

version.fetch('express', function(error, version) {
  if (error) {
    console.error(error);
  } else {
    console.log('express current version: ', version);
  };
});

Example (RegExp formating)

var version = require('version');

version.fetch('express', { from : /^/gi, to : "v" }, function(error, version) {
  if (error) {
    console.error(error);
  } else {
    console.log('express current version with formating:', version);
  };
});

Example (Current Projects package.json)

var version = require('version');

version.fetch(function(error, version) {
  if (error) {
    console.error(error);
  } else {
    console.log('`version` package current version:', version);
  };
});
npm loves you