npm Flashcards

1
Q

What is the abbreviated version of “npm install”?

A

npm i

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What command is used to install all dependencies for a MEVN application using NPM?

A

npm i express cors body-parser mongodb

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the body-parser package used for in NPM?

A

It helps to parse out data from the “body” of requests/responses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the “nodemon” package in NPM?

A

It is used for developing node applications. It automatically restarts the node application when file changes in the directory are made

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In NPM, what are devDependencies?

A

They are modules that are only required during development and not required for runtime (i.e. nodemon)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In NPM, what is the command to install a devDependency?

A

npm i -D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In a package.json file, what is the “start” key-value pair used for?

“scripts”: {“start”: “node server/index.js””}

A

It is where the command is placed to run the application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In a package.json file, what is the “dev” key-value pair used for?

“scripts”: {“dev”: “nodemon server/index.js””}

A

It is used to specify that nodemon will be used during development of the application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Node(.js)?

A

Node is a JavaScript runtime which allows JS to be used as a server-side language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly