# NPM CheatSheet. # Super easy intall: npm comes with node now. # To create your own npm package: https://www.npmjs.org/doc/misc/npm-developers.html # More: https://www.npmjs.org/doc/ # 1. NPM Command Lines. # Local mode is the default. # Use --global or -g on any command to operate in global mode instead. # As of version 0.3, it is recommended to run npm as root. # This allows npm to change the user identifier to the `nobody` user # prior to running any package build or test commands. npm -h # quick help on npm -l # display full usage info npm adduser # add a registry user account npm bin # display npm bin folder npm bugs # bugs for a package in a web browser maybe npm build # build a package (should not be called directly) npm cache [add|ls|clean] # manipulates packages cache npm config [set|get|delete|list|edit] # manage the npm configuration files npm dedupe [package names...] --tag # reduce duplication npm decrecate [@] # deprecate a version of a package (must be the package owner) npm docs [ [ ...]] # docs for a package in a web browser maybe npm edit [@] # edit an installed package (default EDITOR set to "vi") npm explore [@] [ -- ] # browse an installed package npm faq # commonly asked questions npm help-search # search npm help documentation (rarely necessary to call directly) npm help # get help on npm npm init # interactively create a package.json file npm install |tarball> # install a package (optional flags: --save, --save-dev, --save-optional, --save-exact) npm link # symlink a package folder npm ls # list installed packages (as well as their dependencies) npm outdated [ [ ...]] # check for outdated packages npm owner [ls|add|rm] # manage package owners npm pack [ [ ...]] # create a tarball from a package npm prefix # display prefix npm prune [ [ [--tag ] # publish a package npm rebuild [ [ ...]] # rebuild a package npm repo # open package repository in the browser npm restart # start a package npm rm # remove a package npm root # display npm root npm run [] [command] # run arbitrary package scripts npm search [search terms ...] [--long] # search for packages npm shrinkwrap # lock down dependency versions npm star [, ...] # mark your favorite packages npm stars [username] # view packages marked as favorites npm start # start a package npm stop # stop a package npm submodule # add a package as a git submodule npm tag @ # tag a published version npm test # test a package npm unpublish [@] # remove a package from the registry npm unstar [, ...] # Unfavorite specified p npm update [-g] [ [ ...]] # update a package npm version [ | major | minor | patch] # bump a package version npm view [@] [] ...] # view registry info npm whoami # display npm username