Most modern JavaScript projects and packages have a package.json file. This file specifies various metadata about the project, including the following:
- Dependencies
- Descriptions
- Repository information
- Config information
- Common scripts
To initialize our project and create a package.json file, we will run the following command:
npm init
After running the command, a prompt will show up, asking us to fill in some details about the project.
Note: To initialize a project with default values, you can run the npm init command with the -y flag: npm init -y.