add npm and nvm cheetsheet

This commit is contained in:
hirosume 2019-09-24 12:59:32 +00:00
parent 07412e72ed
commit 830073cd42
2 changed files with 31 additions and 0 deletions

20
cheats/npm.cheat Normal file
View file

@ -0,0 +1,20 @@
# initial new package
npm init
# initial immediately a new package
npm init -y
# install all dependencies packages
npm install
# install all dev dependencies packages
npm install --save-dev
# install a specified package
npm install <package-name>
# install a specified dev package
npm install <package-name> --save-dev
# install globally a specified package
npm install <package-name> -g

11
cheats/nvm.cheat Normal file
View file

@ -0,0 +1,11 @@
# install a specified version of node
nvm install <version>
# list available versions
nvm ls-remote
# use installed node's version
nvm use <version>
# set a node's version as default
nvm alias default <version>