In order to get started and create a new project in Node.js we make use of npm init command.

Every Node.js project contains a package.json file where we define project related metadata. It contains dependency declarations, project related scripts, entry point of our application and many more.

In order to create this package.json file npm init command comes in handy.

When I run npm init, it asks me about some metadata about my project and then creates a bare minimum package.json file in the directory where we run this command.

Once created, we can add as many required dependencies to our project as needed. For example, if we need mysql database interaction in our applications then we need to install mysql database module into our application. I do this by the following command :

npm install mysql2

This way I setup my node project.