JSPM

node-version-use

1.4.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5016
  • Score
    100M100P100Q105746F
  • License MIT

Cross-platform solution for using multiple versions of node. Useful for compatibility testing

Package Exports

  • node-version-use
  • node-version-use/dist/cjs/cli.cjs
  • node-version-use/dist/cjs/index.cjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-version-use) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-version-use

Cross-platform solution for using multiple versions of node. Useful for compatibility testing

cli

# specific version
$ nvu 14.4.0 npm run test

# highest of version
$ nvu 12 npm run test

# lts
$ nvu lts npm run test

# comma-delimited list
$ nvu 0.8,4,8,14 npm run test

# use expression
$ nvu >=0.8 node --version

# use engines.node from package.json
$ nvu engines node --version

JavaScript

var assert = require('assert');
var nvu = require('node-version-use');

var isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);
var NODE = isWindows ? 'node.exe' : 'node';

// results is an array per-version of form {version, error, result}
nvu('>=0.8', NODE, ['--version'], { versions: '12', stdio: 'inherit' }, function (err, results) {
  assert.ok(!err, err ? err.message : '');
});

// results is an array per-version of form {version, error, result}
await nvu('engines', NODE, ['--version'], { versions: '12', stdio: 'inherit' });