Last active
June 21, 2016 15:27
-
-
Save remarkablemark/0b58fa9ac332f7558bd87c7d502fc6ef to your computer and use it in GitHub Desktop.
npm resources
npm init -y # use defaults without prompting for options
npm view <package-name>
npm install <package-name>
npm install -g <package-name> # install a package globally
npm install --save <package-name> # package will appear in dependencies
npm install --save-dev <package-name> # package will appear in devDependencies
npm --cache-min 9999999 install <package.name> # install package from the cache
npm install <folder> # install a package that is sitting in a folder on the filesystem
npm ls --depth=0
npm ls --depth=0 -g # list globally installed packages
npm rebuild # useful when all your C++ addons must be recompiled when switching node versions
npm prune # remove extraneous package(s) not listed in package.json
Lock down dependency versions:
npm shrinkwrap
npm install --save --save-exact <package-name>
npm run # list all run scripts
npm run <script-name>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment