NPM Flashcards

1
Q

What is NPM?

A

website, package registry, command line client

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

What is a package?

A

a directory of one or more files on it (reusable codes)
package json

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

How can you create a package.json with npm?

A

npm init –yes

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

What is a dependency and how do you add one to a package?

A

dependency -> piece of software that your software is going to need
npm install dependency_name

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

What happens when you add a dependency to a package with npm?

A

the dependency is added onto dependency list within the package.json
create node module folder
download the dependency onto the folder

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

What Express application method starts the server and binds it to a network PORT?

A

.listen()

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

How do you mount a middleware with an Express application?

A

.use()

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

Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?

A

req & res

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

What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?

A

JSON/application

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

What does the express.json() middleware do and when would you need it?

A

it parse incoming request (on its body) to JavaScript readable object

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

What is the significance of an HTTP request’s method?

A

define methods by server, & client expresses its intent.

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