1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-10-14 15:49:09 +00:00

node: Revamp and optimize 'node' module

Changes:
- nodenv and nvm now honors (and prioritizes) `$XDG_CONFIG_HOME` over
  `$HOME` to lookup local nodenv/nvm installation.
- Make `nvm` loading lazy (via `--no-use` argument).
- Remove redundant NODENV_ROOT or NVM_DIR, respective script already
  set them up.
- Adhere to more idiomatic Zsh operation and minimize external command
  usage (like `sed`).
This commit is contained in:
Indrajit Raychaudhuri
2021-05-13 15:37:46 -05:00
committed by Indrajit Raychaudhuri
parent c6b59f8bb1
commit af46875c5e
3 changed files with 27 additions and 19 deletions

View File

@@ -9,7 +9,7 @@ enables [_npm_][2] completion.
home directory.
This will be loaded automatically if nvm is installed in `$NVM_DIR`,
_`~/.nvm`_, or nvm is installed with Homebrew.
_`$XDG_CONFIG_HOME/nvm`_, _`~/.nvm`_, or is installed with homebrew.
## nodenv
@@ -18,7 +18,7 @@ Node versions. It is simple and predictable, Just Works, and is rock solid in
production. nodenv is forked from the popular [_rbenv_][7].
This will be loaded automatically if nodenv is installed in `$NODENV_ROOT`,
_`~/.nodenv`_, or `nodenv` is on the path.
_`$XDG_CONFIG_HOME/nodenv`_, _`~/.nodenv`_, or `nodenv` is on the path.
## Functions
@@ -46,11 +46,12 @@ _The authors of this module should be contacted via the [issue tracker][4]._
- [Sorin Ionescu](https://github.com/sorin-ionescu)
- [Zeh Rizzatti](https://github.com/zehrizzatti)
- [Indrajit Raychaudhuri](https://github.com/indrajitr)
[1]: http://nodejs.org
[2]: http://npmjs.org
[3]: http://nodejs.org/api
[4]: https://github.com/sorin-ionescu/prezto/issues
[5]: https://github.com/creationix/nvm
[5]: https://github.com/nvm-sh/nvm
[6]: https://github.com/nodenv/nodenv
[7]: https://github.com/sstephenson/rbenv