Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
wspl committed Jun 3, 2022
1 parent eec0c1e commit 1d6f2d2
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
# Nuke
A Node.js version manager for Windows, aimed at using different versions of Node.js in different terminals at the same time.
An out-of-the-box Node.js version manager for Windows, aimed at using different versions of Node.js in different terminals at the same time.

**There are still some key features missing from this tool, and I will eventually complete them. If you want to participate, please feel free to create a PR.**

## Features
- Download and manage multiple Node.js versions (and architectures)
- Switch the version used by the current shell via environment variables
- Switch the global(or default) version via command
- No version conflicts: terminals using different versions do not interfere with each other.
- No version conflicts: terminals using different versions do not interfere with each other

## Comparison
| | Nuke | nvm-windows | fnm | nodist |
|-----------------------------------|------|-------------|------|---------|
| Language | Rust | Go | Rust | Node.js |
| Zero configuration ||| | |
| Use multiple version at same time || |||
| No post-script required ||| ||
| No elevated privileges required || || |
| Differentiate Architecture |||| |

## Why not nvm-for-windows?
Nuke uses a different solution than nvm-for0windows. nvm-for-windows manages Node.js versions by creating shell link (or symbol link) under `%PROGRAMFILES%`, which means that only one version of Node.js can be used at the same time. Nuke uses a pratice similar to `cargo` of Rust, which creates launchers with the same name as the Node.js commands. Launcher detects the version of Node.js the user wants to use when running, and then launches the corresponding Node.js. This approach allows users to use any version of Node.js at the same time.
My research may not have gone far enough, please feel free to correct any inaccurate information.

## Setup
### I. Install Nuke
### 1. Install Nuke
1. Download nuke from [GitHub Releases](https://github.com/wspl/nuke/releases).
2. Double click to start `nuke.exe`
3. Press `Y` to allow nuke to install on your computer.
4. Open a command prompt (e.g. cmd, powershell) and use the `nuke` command.

### II. Install Node.js
### 2. Install Node.js
Nuke provides the `install` command for installing Node.js.
```
nuke install <Node.js Version> [--arch <Arch>]
Expand All @@ -25,7 +37,7 @@ For example, if you want to install the latest version of Node.js with major ver
```
nuke install 18
```
### III. Switch Node.js Version
### 3. Switch Node.js Version
When you have multiple versions of Node.js installed, you can switch versions in two ways.
#### Command
The `nuke default` command allows you to switch the version of Node.js used globally.
Expand All @@ -40,7 +52,13 @@ $env:NUKE_NODE_ARCH=x86
npm install
```
### IIII. More help
### 4. More help
```
nuke -h
```
```

## Why a new Node.js version manager
I often need to use both 64-bit and 32-bit Node.js for some build tasks on a single windows continuous integration machine. At the same time there are other guys using Node.js on this server to do other things. But nvm-windows doesn't allow us to use different versions of Node.js at the same time. When I switched to other alternative tools, the complex configuration gave me a huge headache. So I simply wrote my own tool to solve this problem.

## How does it work?
Once Nuke is installed, it creates several executables in the `bin` folder called `node.exe`, `npm.exe` and `npx.exe`, which are actually Nuke Launcher. The `bin` folder is added to the operating system's PATH environment variable when Nuke is installed. Before you need to use Node.js, you can set an environment variable that lets Nuke Launcher know what version of Node.js you want to use, so that when you start Nuke Launcher with the `node` command, it knows what version of Node.js to launch and starts it as a child process with all parameters passed through.

0 comments on commit 1d6f2d2

Please sign in to comment.