What is package.json? What is it used for?
This file holds various metadata information about 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.
Some of the fields are: name
, name
, description
, author
and dependencies
.
When someone installs our project through npm
, all the dependencies listed will be installed as well. Additionally, if someone runs npm install
in the root directory of our project, it will install all the dependencies to ./node_modules
directory.
Comments
Post a Comment