0.1.0 • Published 10 years ago

nversion v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

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.