From c5f83d31f5e5667436101305c59512f9f9b86ab3 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sun, 16 May 2021 22:04:27 -0500 Subject: [PATCH] node: Add environment variable to store 'n' cache See: https://github.com/tj/n#installation for details. --- modules/node/README.md | 5 +++++ modules/node/init.zsh | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/modules/node/README.md b/modules/node/README.md index edff6e6..f72acf6 100644 --- a/modules/node/README.md +++ b/modules/node/README.md @@ -23,6 +23,10 @@ home directory. This will be loaded automatically if nvm is installed in `$NVM_DIR`, _`$XDG_CONFIG_HOME/nvm`_, _`~/.nvm`_, or is installed with homebrew. +## Variables + +- `N_PREFIX` stores the path to [_n_][8] cache. + ## Functions - `node-doc` opens the Node.js online [API documentation][3] in the default @@ -58,3 +62,4 @@ _The authors of this module should be contacted via the [issue tracker][4]._ [5]: https://github.com/nodenv/nodenv [6]: https://github.com/sstephenson/rbenv [7]: https://github.com/nvm-sh/nvm +[8]: https://github.com/tj/n diff --git a/modules/node/init.zsh b/modules/node/init.zsh index 5051570..bc21093 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -37,3 +37,9 @@ elif (( $+commands[brew] )) \ elif (( ! $+commands[node] )); then return 1 fi + +# +# Variables +# + +N_PREFIX="${XDG_CONFIG_HOME:-$HOME/.config}/n" # The path to 'n' cache.