Node Flashcards

1
Q

npm -commands should always be run in the project r.._ directory

A

npm -commands should always be run in the project root directory

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

when we want to save something as a development dependency, we need to remember the –save-d._ flag

A

when we want to save something as a development dependency, we need to remember the –save-dev flag

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

you have already used nodemon, but ts-node has an alternative called ts-node-d._

A

you have already used nodemon, but ts-node has an alternative called ts-node-dev

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

All HTTP requests except POST should be id____tent

(This means that if a request does not generate side effects, then the result should be the same regardless of how many times the request is sent.)

A

All HTTP requests except POST should be idempotent:

Methods can also have the property of “idempotence” in that (aside from error or expiration issues) the side-effects of N > 0 identical requests is the same as for a single request. The methods GET, HEAD, PUT and DELETE share this property

This means that if a request does not generate side effects, then the result should be the same regardless of how many times the request is sent.

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

Deployment p______ means an automated and controlled way to move the code from the computer of the developer through different tests and quality checks to the production environment.

A

Deployment pipeline means an automated and controlled way to move the code from the computer of the developer through different tests and quality checks to the production environment.

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

Dotenv is a zero-dependency module that loads environment variables from a .env file into p______.env.

A

Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env

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

The .env file should be ________-ed right away since we do not want to publish any confidential information publicly online!

A

The .env file should be gitignored right away since we do not want to publish any confidential information publicly online!

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

The environment variables defined in the .env file can be taken into use with the expression require(‘dotenv’)._____()

A

The environment variables defined in the .env file can be taken into use with the expression require(‘dotenv’).config()

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

The execution order of middleware is the same as the order that they are loaded into Express with the app.___ function. For this reason, it is important to be careful when defining middleware.

A

The execution order of middleware is the same as the order that they are loaded into Express with the app.use function. For this reason, it is important to be careful when defining middleware.

app.use(express.static(‘dist’))
app.use(express.json())
app.use(requestLogger)

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

import cors from “____”

const app = express();
app.use(cors___)

A

import cors from “cors”

const app = express();
app.use(cors( ))

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