What are some NPM commands you should know?
What is NPM?
NPM stands for Node Package Manager, and is used when installing third party packages or modules in node applications.
Some basic NPM commands
-
npm init
This is used to create thepackage.jsonfile. -
npm lsThis is used to list the packages or modules in your project together with their dependencies. -
npm i <package>ornpm install <package>
This is the command used to install a package. -
npm un <package>ornpm uninstall <package>
This is used to uninstall a package. -
npm publish
This is used to publish a package. -
npm run
This lists the available scripts that can be run on your project. -
npm stop
This is used to stop a script. -
npm cache clean --forceThis force cleans thenpmcache. -
npm search <package>
This is used to search for a package in your project folder. -
npm view <package>
This is used to show data about a package and print it to the screen.