nvm

Install command:
brew install nvm

Manage multiple Node.js versions

https://github.com/nvm-sh/nvm

License: MIT

Development: Pull requests

Formula JSON API: /api/formula/nvm.json

Formula code: nvm.rb on GitHub

Bottle (binary package) installation support provided.

Current versions:

stable 0.40.4
head ⚡️ HEAD
Please note that upstream has asked us to make explicit managing
nvm via Homebrew is unsupported by them and you should check any
problems against the standard nvm install method prior to reporting.

You should create NVM's working directory if it doesn't exist:
    mkdir ~/.nvm

Add the following to your shell profile e.g. ~/.profile or ~/.zshrc:
    export NVM_DIR="$HOME/.nvm"
    [ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && \. "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" # This loads nvm
    [ -s "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion

You can set $NVM_DIR to any location, but leaving it unchanged from
$HOMEBREW_CELLAR/nvm/0.40.4 will destroy any nvm-installed Node installations
upon upgrade/reinstall.

Type `nvm help` for further information.

Analytics:

Installs (30 days)
nvm 43,801
nvm --HEAD 97
Installs on Request (30 days)
nvm 43,798
nvm --HEAD 97
Build Errors (30 days)
nvm 0
Installs (90 days)
nvm 153,579
nvm --HEAD 263
Installs on Request (90 days)
nvm 153,569
nvm --HEAD 263
Installs (365 days)
nvm 487,638
nvm --HEAD 978
Installs on Request (365 days)
nvm 487,582
nvm --HEAD 978