Skip to content

tomdos/version

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
  };
});

Bitdeli Badge

About

Node.js package.json version number fetcher

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%