GithubHelp home page GithubHelp logo

nve's Introduction

Codecov Travis Gitter Twitter Medium

Run any Node.js version.

This executes a file, command or REPL using a specific Node.js version.

Unlike nvm run it:

  • is 10 times faster
  • does not need a separate installation step for each Node version
  • works on Windows
  • does not require Bash
  • is installed as a Node module (as opposed to a Bash installation script downloaded with curl)

This executes a single file or command. To run a specific Node.js version for an entire project or shell session, please use nvm, nvm-windows, n or nvs.

Examples

# Same as `node` but with Node 12
$ nve 12
Welcome to Node.js v12.8.0.
Type ".help" for more information.
> .exit

# Same as `node file.js` but with Node 8
$ nve 8 file.js

# Any Node CLI flag can be used
$ nve 8 --print 'process.version'
v8.16.0

# Run a specific version
$ nve 8.10.0 --version
v8.10.0

# Run the latest Node version
$ nve '*' --version
v12.8.0

# Use a version range
$ nve '<8' --version
v7.10.1

Demo

You can try this library:

Install

npm install -g nve

node >=8.12.0 must be globally installed. However the command run by nve can use any Node version.

Usage

nve VERSION [ARGS...]

This is exactly the same as:

node [ARGS...]

But using a specific Node version. Any Node CLI flag can be passed.

VERSION can be any version range such as 12, 12.6.0 or <12.

The first time nve is run with a new VERSION, the Node binary is downloaded from nodejs.org under the hood. This initially takes few seconds. However subsequent runs are almost instantaneous.

Node.js mirror

The binaries are downloaded from https://nodejs.org/dist. You can specify a mirror website using the environment variable NODE_MIRROR.

NODE_MIRROR="https://npm.taobao.org/mirrors/node" nve VERSION [ARGS...]

Benchmarks

The following benchmarks compare the average time to run nve, nvm run and npx node:

nve:        68ms
nvm run:   852ms
npx node: 1385ms

See also

Support

If you found a bug or would like a new feature, don't hesitate to submit an issue on GitHub.

For other questions, feel free to chat with us on Gitter.

Everyone is welcome regardless of personal background. We enforce a Code of conduct in order to promote a positive and inclusive environment.

Contributing

This project was made with โค๏ธ. The simplest way to give back is by starring and sharing it online.

If the documentation is unclear or has a typo, please click on the page's Edit button (pencil icon) and suggest a correction.

If you would like to help us fix a bug or add a new feature, please check our guidelines. Pull requests are welcome!

Thanks go to our wonderful contributors:

ehmicky
ehmicky

๐Ÿ’ป ๐ŸŽจ ๐Ÿค” ๐Ÿ“–
Scott Warren
Scott Warren

๐Ÿ’ฌ

nve's People

Contributors

allcontributors[bot] avatar ehmicky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.