Package Manager
Npm
Pnpm
Command
Understanding dependencies inside your Package.json - NodeSource
npm init
to initialize a project
Parameters
-
-g
the-g
flag is a shorthand for theglobal
configuration 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
TheS
option 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-D
or--save-dev
flag to the npm uninstall, and then specify the name of the package.
Tools
depcheck
Find unused npm packages in package.json
ncu
Update dependencies.