Package Exports
- version
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (version) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
version
Node.js package.json version number fetcher
Installation
$ npm install versionExample (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);
};
});