NPM - Node Package Manager¶
When installing NPM packages a
node_modules folder is added to your project. If you are using git, then this is something you want to add to your .gitignore file.
NPM is a command line tool and is installed when you install nodejs. So even if you don't use Nodejs in your project, you will probably have it installed on your machine so you can use NPM.
NPM has a couple of basic commands:
||This installs a package as a dependency (used for frameworks and libraries)|
||This installs a package as a developer's dependency (used for packaging tools and stuff not required in production)|
||Used if you want to install a tool globally, after this the package often runs a like a software app. examples are:
||Default way to run your application, if specified in package.json|
||A wizard to take you through the creation of a package.json file|
||The wizard is skipped and a package.json file is created using default values.|
What is package.json?
All npm packages contain a file, usually in the project root, called package.json - this file holds various metadata relevant to the project. This file is used to give information to npm that allows it to identify the project as well as handle the project's dependencies. It can also contain other metadata such as a project description, the version of the project in a particular distribution, license information and et al.