https://github.com/nick-gabe/nvm-switcher
Automatically switch node versions based on package.json recommended engine.
https://github.com/nick-gabe/nvm-switcher
node nvm
Last synced: 3 months ago
JSON representation
Automatically switch node versions based on package.json recommended engine.
- Host: GitHub
- URL: https://github.com/nick-gabe/nvm-switcher
- Owner: Nick-Gabe
- Created: 2023-12-31T03:16:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-30T03:39:04.000Z (over 1 year ago)
- Last Synced: 2025-04-05T18:54:08.008Z (6 months ago)
- Topics: node, nvm
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 36
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ↬ Node nvm-switcher
Automatically switch node versions through nvm based on package.json recommended engine version.
## How to install
- First of all, make sure you have `NVM` installed:
- Windows: [nvm-windows repo](https://github.com/coreybutler/nvm-windows)
- Linux/Mac: [nvm repo](https://github.com/nvm-sh/nvm)
- Clone this repository into any folder you'd like:
- `git clone https://github.com/Nick-Gabe/nvm-switcher.git`
- Install the code in your shell:
- Check what is the configuration file of your shell, for example `.zshrc`, `.bashrc`, `$profile`...
- Add the following line to the end of it: `nvm use $(node /nvm-switcher)`
- Replace `` by the directory the repository is in.After all those steps, once you open a shell, it will automatically execute the `nvm-switcher` command and find the optimal version for you.
### Want to contribute?
- Fork the repo [here](https://github.com/Nick-Gabe/nvm-switcher/fork)
- Clone it:```shell
git clone https://github.com//nvm-switcher.git
# replace with your username
```- Do the changes and updates, push them to your repository
- Create a Pull Request [here](https://github.com/Nick-Gabe/nvm-switcher/compare)!## Why make the code in Javascript?
Since we're talking about node versions, you should already have node in your system,
therefore using `javascript` provides a more understandable code and easier API than
`bash` for example.But this might change at some point, due to `javascript` not being the most optimal
language in terms of speed for this kind of operation which requires running terminal commands.