Node Flashcards

1
Q

What is Node.js?

A

program that lets JavaScript to be run outside of a web browser

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

build back end for Web applications, command-line programs, or any kind of automation that developers wish to perform

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

takes input, reads and executes it, then returns the result to the user

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

When was Node.js created?

A

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, C, C++, java, C#, PHP, JavaScript, Go, Rust, Assembly

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

What is a computer process?

A

a computer program being executed

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

Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?

A

~300

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

Why should a full stack Web developer know that computer processes exist?

A

Full stack Web development is based on making multiple processes work together to form one application, so having at least a cursory awareness of computer processes is necessary

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

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

A

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
10
Q

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

A

console.log(process);

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

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

A

array

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

What is a JavaScript module?

A

a single JavaScript file

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

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

A

process and console

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

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

A

instructions/command that tells node.js which bits of code can be exported so that other files may access them

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

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

A

require(./filename)

./ looks in current directory

17
Q

What is the JavaScript Event Loop?

A

thing that looks at the stack and pushes first item in the queue to the stack IF the stack is empty

18
Q

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

A

blocking occurs when an item in the stack takes a while and stalls the program - this can happen in synchronous codes
non-blocking executes “multiple threads” at a time by utilizing browsers to manage asynchronous codes (callbacks)

19
Q

What is a directory?

A

a collection of files

20
Q

What is a relative file path?

A

path to the file from the current directory

21
Q

What is an absolute file path?

A

path to the file from the root

filepath starts with ‘/’ and only that

22
Q

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

A

fs

23
Q

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

A

fs.writeFile

24
Q

Are file operations using the fs module synchronous or asynchronous?

A

both, they have synchronous and asynchronous methods