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: namenamedescriptionauthor 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

Popular posts from this blog

Which node logger did you use in your project?

What is promise, promise.all and promise.race? How do you chain promises?