Update npm
npm i -g npm@VERSION
Create package.json
1 2 3 4 5
| npm init
npm init --yes
|
List existing packages
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| npm list
npm list --depth=0
npm view mongoose
npm view mongoose dependencies
npm view mongoose versions
|
Versioning
Semantic format: Major.Minor.Patch
Update local package
1 2 3 4 5 6 7 8
| npm outdated
npm -g outdated
npm update
|
Use npm-check-updates to update packages
1 2 3 4 5 6 7 8 9 10 11 12
| npm i -g npm-check-updates
npm-check-updates
ncu
ncu -u
npm i
|
Install dev dependencies
Uninstall package
Publish own packages to npm
1 2 3 4 5
| mkdir lion-lib cd lion-lib npm init --yes npm login npm publish
|