Skip to content

sahilrajput03/nvm-autoswitching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

README

NVM: Docs

Inspiration: here

Set default version of nvm

nvm alias default 20.12.0
# Other versions 16.14.2, etc.
nvm use default

Creating a .nvmrc file

node -v > .nvmrc

FYI: You can simply write 12 or 14 for corresonding node versions as well as I have done in this current demo.

What to do to make autoswitching seamlessly?

In your .bashrc file you can have something like below and then autoswitching of node versions will happen quite amazingly!

nvmUse () {
	if [ -f ".nvmrc" ]; then
		nvm use
	fi
}

function cd {
    # actually change the directory with all args passed to the function
    builtin cd "$@"

	nvmUse
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published