Created
July 26, 2016 03:46
-
-
Save gucheen/01d6f1aa3746068e4c000cd0abe2e0b9 to your computer and use it in GitHub Desktop.
lazy load nvm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nvm() { | |
unset -f nvm | |
export NVM_DIR=~/.nvm | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
nvm "$@" | |
} | |
node() { | |
unset -f node | |
export NVM_DIR=~/.nvm | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
node "$@" | |
} | |
npm() { | |
unset -f npm | |
export NVM_DIR=~/.nvm | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
npm "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment