Test if version-ish string is compatible with current Node version
npm install compatible-version --save
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
MIT © Daniel Eckermann