Skip to content

Instantly share code, notes, and snippets.

@jhliberty
Forked from fl0w/lazynvm.sh
Created July 31, 2016 13:31
Show Gist options
  • Save jhliberty/cb7dcca85c3221fb16603cbac0d09116 to your computer and use it in GitHub Desktop.
Save jhliberty/cb7dcca85c3221fb16603cbac0d09116 to your computer and use it in GitHub Desktop.
# lazyload nvm
# all props goes to http://broken-by.me/lazy-load-nvm/
# grabbed from reddit @ https://www.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/
lazynvm() {
unset -f nvm node npm
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
}
nvm() {
lazynvm
nvm $@
}
node() {
lazynvm
node $@
}
npm() {
lazynvm
npm $@
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment