Skip to content

Commit 62ed075

Browse files
authored
Update Node-and-Packages.md
1 parent 5c027b2 commit 62ed075

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Node-and-Packages.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A package in Node can be used to add the following:
1717

1818
An online egistry to search for node packages.
1919

20-
## 3. `package.json` file
20+
## 3. Initialize `npm` in an application and create a `package.json` file
2121

2222
The `package.json` file is created when the following command is ran in terminal:
2323

@@ -29,6 +29,27 @@ The `package.json` file contains the following:
2929
* Dependencies - the list of packages used by your project
3030
* Scripts - commands to automate development tasks e.g `npm start` will run the application server
3131

32+
Example of a `package.json` file
33+
34+
```json
35+
{
36+
"name": "demo-web-server",
37+
"version": "1.0.0",
38+
"description": "",
39+
"main": "index.js",
40+
"scripts": {
41+
"test": "echo \"Error: no test specified\" && exit 1"
42+
},
43+
"keywords": [],
44+
"author": "Alex Paul",
45+
"license": "ISC"
46+
}
47+
```
48+
49+
To bypass initialization questions
50+
51+
`npm init -y`
52+
3253
## 4. Installing a package
3354

3455
Download and add package and dependencies to be included in production.

0 commit comments

Comments
 (0)