> Zsh plugin for installing, updating and loading `nvm`
[`nvm`](https://github.com/creationix/nvm) is an awesome tool but it can be kind of a pain to install and keep up to date. This zsh plugin allows you to quickly setup `nvm` once, save it in your dotfiles, then never worry about it again.
The plugin will install the latest stable release of `nvm` if you don't already have it, and then automatically `source` it for you. You can upgrade `nvm` to the latest version whenever you want without losing your installed `node` versions by running `nvm upgrade`.
Once the plugin's installed `nvm` will be available. You'll probably want to load this as one of your first plugins so `node`/`npm` is available for any other plugins that may require them.
If you find `nvm` adds too much lag to your shell startup you can enable lazy loading by exporting the `NVM_LAZY_LOAD` environment variable and setting it to `true`. Lazy loading is around 70 times faster to load, however the first time you run `nvm`, `npm`, `node` or a global module you'll get a slight delay while `nvm` loads first. You'll only get this delay once per session.
For example, if you are using antigen, you would put the following in your `.zshrc`:
```shell
export NVM_LAZY_LOAD=true
antigen bundle lukechilds/zsh-nvm
```
Performance comparison:
```shell
% time (_zsh_nvm_load)
( _zsh_nvm_load; ) 0.58s user 0.37s system 109% cpu 0.874 total
$ time (_zsh_nvm_lazy_load)
( _zsh_nvm_lazy_load; ) 0.01s user 0.01s system 168% cpu 0.012 total
```
Note: This feature is experimental, use with caution.