Node.JS Flashcards

1
Q

What is Node.js?

A

A JavaScript runtime

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

What can Node.js be used for?

A

is used to execute JavaScript outside of the browser

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

What is a REPL?

A

Read Eval Print Loop. a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user

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

What is a computer process?

A

A program that is running on your computer

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

What is the process object in a Node.js program?

A

that provides information about, and control over, the current Node.js process.

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

How do you access the process object in a Node.js program?

A

by name, its always there.

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

What is the data type of process.argv in Node.js?

A

an array of strings.

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

What is a JavaScript module?

A

a single file that should preform a specific task

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

What values are passed into a Node.js module’s local scope?

A

exports, require, module, __filename, __dirname

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

Give two examples of truly global variables in a Node.js program.

A

process object and console.

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

What is the purpose of module.exports in a Node.js module?

A

to be able to send data to other modules

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

How do you import functionality into a Node.js module from another Node.js module?

A

using the require method. ex require(‘./add’)

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

What module does Node.js include for manipulating the file system?

A

the fs module

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

What does express.static() return?

A

a middleware function that probably has all the contents of a specified file

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

What is the local __dirname variable in a Node.js module?

A

it provides the absolute path to the current directory

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

What does the join() method of Node’s path module do?

A

it joins multiple file paths or names into one simplified string.