When you do npm init you might have entered the values like the below in CLI:
name: (testApp)
Sorry, name can no longer contain capital letters.
name: (testApp) testApp
Sorry, name can no longer contain capital letters.
name: (testApp) test-app
version: (1.0.0)
description: This is a test app
entry point: (index.js) app.js
test command: npm test
git repository:
keywords:
author: Sagar Gopale
license: (ISC)
About to write to /home/sagargopale/Projects/testApp/package.json:
Then there is package.json created as follows with the above configuration:
{
"name": "test-app",
"version": "1.0.0",
"description": "This is a test app",
"main": "app.js",
"scripts": {
"test": "npm test"
},
"author": "Sagar Gopale",
"license": "ISC"
}
When you install any dependency it will add the dependencies block in package.json. For example if I do
npm install express --save
then the package.json will look like below:
{
"name": "test-app",
"version": "1.0.0",
"description": "This is a test app",
"main": "app.js",
"scripts": {
"test": "npm test"
},
"author": "Sagar Gopale",
"license": "ISC",
"dependencies": {
"express": "^4.14.0"
}
}