NPM.isVersionCompatible()

Determine whether or not a particular NPM version string is compatible within a semver range.

Usage

Hover over inputs/exits for more info.

var NPM = require('machinepack-npm');


// Determine whether or not a particular NPM version string is compatible within a semver range.

NPM.isVersionCompatible({

version: '1.2.5',

semverRange: '^4.9.0',

}).execSync();

Inputs

version required

NPM version to check.

'1.2.5'
semverRange required

Semver range to check against for compatibility.

'^4.9.0'

Exits

error

An unexpected error occurred.

success

OK.

false