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

What is a Callback function in Node.js?

What is an Event loop in Node.js and how does it work?