package.json

In order to add dependency packages to your project, you need to create package.json file. This file is used to store the metadata associated with that project as well as to store the list of dependency packages.

The benefits of having package.json file are described below.

Reference https://docs.npmjs.com/getting-started/using-a-package.json

Creating "package.json"

Open Command Prompt.

Navigate to the directory in which you want to create package.json.

Run the following command

> npm init

Press enter for the list of questions to get initiated and type "yes" to create the package.json file.

The file will be created in the respective directory and it looks like the below screenshot.

Specify dependent packages

Navigate to the directory and edit package.json manually.

You could add 2 types of packages, as shown below.