Package Manager
Npm
npm config set registry https://registry.npmmirror.comPnpm
pnpm setup
pnpm config set registry https://registry.npmmirror.comCommand
Understanding dependencies inside your Package.json - NodeSource
npm initto initialize a project
Parameters
-
-g
the-gflag is a shorthand for theglobalconfiguration which sets the package install location to the folder where you installed NodeJS.
This is useful when you need to run the package from the command line instead of usingrequire()and import it to your code. -
-S
TheSoption is the Save option in npm. It adds the npm package to your dependencies for your project. You can also add the dependency manually by editing the package.json file. -
-D
To remove a dev dependency, you need to attach the-Dor--save-devflag to the npm uninstall, and then specify the name of the package.
Tools
depcheck
Find unused npm packages in package.json
ncu
Update dependencies.