compatible-version
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

compatible-version

Test if version-ish string is compatible with current Node version

Travis npm version npm downloads npm license eslint

Installation

npm install compatible-version --save

Usage

const compatible = require('compatible-version');
 
// Given Node.js 8.10.0
compatible('v8.10.0');
//=> true
 
// Given Node.js 8.10.0
compatible('8.10');
//=> true
 
// Given Node.js 8.10.0
compatible('v8');
//=> true
 
// Given Node.js 8.10.0
compatible('v8.10.2');
//=> false
 
// Given Node.js 8.10.0
compatible('8.8');
//=> false
 
// Given Node.js 8.10.0
compatible('v10');
//=> false

License

MIT © Daniel Eckermann

Dependencies (0)

    Dev Dependencies (11)

    Package Sidebar

    Install

    npm i compatible-version

    Weekly Downloads

    129

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    7.7 kB

    Total Files

    10

    Last publish

    Collaborators

    • ecrmnn