Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 770 Bytes

README.md

File metadata and controls

38 lines (28 loc) · 770 Bytes

Version (NodeJS 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);
  };
});