https://github.com/iamogbz/nvshim
🍄 Automagically use the correct version of node with nvm
https://github.com/iamogbz/nvshim
n n-shim node node-shim nvm nvm-shim shell shim
Last synced: 14 days ago
JSON representation
🍄 Automagically use the correct version of node with nvm
- Host: GitHub
- URL: https://github.com/iamogbz/nvshim
- Owner: iamogbz
- License: unlicense
- Created: 2019-07-06T22:56:45.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-31T00:33:22.000Z (over 1 year ago)
- Last Synced: 2024-05-02T01:37:08.840Z (12 months ago)
- Topics: n, n-shim, node, node-shim, nvm, nvm-shim, shell, shim
- Language: Python
- Homepage: https://ogbizi.com/nvshim/
- Size: 204 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- jimsghstars - iamogbz/nvshim - 🍄 Automagically use the correct version of node with nvm (Python)
README
# NVM Shim

Automagically use the correct version of node with [`nvm exec`](https://github.com/nvm-sh/nvm#usage) functionality.

[](https://coveralls.io/github/iamogbz/nvshim?branch=master)
[](https://pypi.org/project/nvshim/)


[](https://app.dependabot.com)> **No more `nvm use`**
This will use existing [`.nvmrc`](https://github.com/nvm-sh/nvm#nvmrc) file, falling back to the [`nvm alias default`](https://github.com/nvm-sh/nvm#usage-1) version if no config detected.
## Installation
### Pip
```sh
pip install nvshim
```### Github
```sh
pip install git+git://github.com/iamogbz/nvshim.git
```## Configuration
Reads all configuration from the environment.
### [`NVM_DIR`](https://github.com/nvm-sh/nvm#installation-and-update)
Relies on `nvm` being installed and configured correctly.
### `NVSHIM_AUTO_INSTALL`
Set to `1` or `true` to auto install specified version of node if not installed by `nvm`.
### `NVSHIM_VERBOSE`
Set to `1` or `true` to show more information on the shimmed node process.
Otherwise set to `0` or `false` or nothing.
## Caveats
1. To allow the `nvshim` installed `node` shim work in all directories, you'll need to stop sourcing `nvm.sh` in your shell rc i.e. `bash_profile`, `zshrc` etc.
- Just comment out the `source /Users/me/.nvm/nvm.sh` in your shell startup script. This is optional and prevents `nvm` from taking control of your shell path on launch.
- With `nvm` shimmed, `nvm use` commands do not have any effect on the shell, the `node` version is already always gotten from the config automatically.1. The scope of this project only shims the `node`, `npm`, `npx` and `nvm` binaries. Any globally installed modules are not automatically shimmed.
- It is still easy to run a specific global bin e.g. `npx eslint` will alway run the version of `eslint` installed via the `node` version for the current shell.
- Indicate your interest in having this tool shim all binaries installed via node by leaving a comment [here](https://github.com/iamogbz/nvshim/issues/137).## Contribution
All forms of contribution welcome, please see [guide](./CONTRIBUTING.md).
```sh
make install
``````sh
make tests a="--snapshot-update"
```