nversion
v0.1.0
Published
Simple validation for node version based on process.version, without dependencies.
Downloads
2
Readme
nversion
Simple validation for node version based on process.version, without any dependencies. Just require "nversion" module to get patter-based node engine version validation.
var nversion = require('nversion');
nversion.match('< 0.6.3', function() {
console.log("Sorry, find some better engine!");
});
Installation
$ npm install nversion
API
nversion.match
Accepts pattern
and optional callback
. Return true and invokes callback
, if process.version
match pattern
. Valid patterns:
nversion.match('< 0.6.3');
nversion.match('<= 0.9');
nversion.match('= 0.12.5');
nversion.match('> 0.11');
nversion.match('>= 0.10.7');
nversion.major, nversion.minor, nversion.patch
If anyone would ever need it, returns major, minor and patch component of version respectively (as number)
MIT Licence.