npm init
: NPM package manifest wizardnpm whoami
: check for the authenticated usernpm adduser
: add a user to the NPM sessionnpm init --scope=<username>
: add the auth user to the NPM .json manifestnpm install <modulename>
: installing a specific NPM module or packagenpm ls
: dependencies listing (specific directory)npm test
: run tests using the scripts located at the package.json filenpm publish
: publish a package to the NPM repository, or updates or bug fixesnpm view @davidlares/how-to-npm-davidlares
: check package detailsnpm version
: modify the package.json in order to the specified version
Patch Version -> Update every change (third number)
Minor Version -> Update for API additions (second number)
Major Version -> Update for breaking API changes (first number)
Tags usage: by default = latest
You can add tags to the previous versions of the code, but no the last of it By default: the last one automatically have the 'latest' tag
npm dist-tag add [email protected] beta
npm dist-tag add @davidlares/[email protected] beta
You will unable to delete LATEST tag
npm dist-tag rm @davidlares/how-to-npm-davidlares <tag>
npm outdated
: check for outdated packagesnpm update
: update project dependenciesnpm rm <PKG>
: remove project dependencies