|
|
|
|
|
by prodigycorp
163 days ago
|
|
Holy heck, I just profiled my zsh initialization and nvm was the big source of bloat, holy hell. Similar setup as you (M4 MBP), same amount of startup bloat. Lazy loading it fixes it. GPT-5.2 changed the nvm initialization script to: export NVM_DIR="$HOME/.nvm"
_nvm_lazy_load() {
unset -f nvm node npm npx _nvm_lazy_load
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
}
nvm() { _nvm_lazy_load; nvm "$@"; }
node() { _nvm_lazy_load; command node "$@"; }
npm() { _nvm_lazy_load; command npm "$@"; }
npx() { _nvm_lazy_load; command npx "$@"; }
|
|
Mise reads in your .nvmrc files so you don't have to configure anything new.