Node Flashcards

1
Q

What is Node.js?

A

An environment that allows you to execute javascript code without a browser needed

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

Building servers without blocking code

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 programming environment that takes and runs user input, and returns the result, one line at a time

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

When was Node.js created?

A

May 2009

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

What back end languages have you heard of?

A

Python, Ruby, PHP, JavaScript, C#/.Net, C++ (online game servers)

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

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

A

The process object is a global 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
7
Q

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

A

By using the process variable name

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

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

A

an array

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

What is a JavaScript module?

A

a .js file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
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
11
Q

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

A

console, process

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

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

A

To be able to use functions and values between modules

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

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

A

require(./name)

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

What is the JavaScript Event Loop?

A

Facilitates the order of operations for asynchronous code by monitoring the callback queue and the call stack

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

What is different between “blocking” and “non-blocking” with respect to how code is executed?

A

Synchronous and asynchronous
Blocking code prevents other operations from occurring
Non-blocking code can run in the background while other operations take place

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

What is a directory?

A

a folder, or a group of files

17
Q

What is a relative file path?

A

directions to a target file from the current location

18
Q

What is an absolute file path?

A

The complete path to a target file, beginning from the root directory/drive

19
Q

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

A

fs

20
Q

What method is available in the Node.js fs module for writing data to a file?

A

writeFile()

21
Q

Are file operations using the fs module synchronous or asynchronous?

A

asynchronous