Node.js Flashcards

1
Q

What is Node.js?

A

Javascript not in a 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

To build backends

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

What is a REPL?

A

A shortcut for read, eval, print, loop
Ie:
Google dev tools

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

When was Node.js created?

A

In 2009 by Ryan Dahl

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++, Java, C, Ruby, Perl

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

What is a computer process?

A

An instance of a program that is 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

100s or more

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

So they know how much memory their app takes and the relationship between front end and backend

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

A JavaScript object in Node that is a model of the computers Node.js that is currently running
(Similar to browser Window object)

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

Just “process” because it’s global

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

An array of strings

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

What is a JavaScript module?

A

A way to separate applications into different files

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

Dirname, filename, require, module, exports

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 + URL

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

It allows variables from other modules to be used

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

Using the require function with a relative path as the argument

17
Q

What is the JavaScript Event Loop?

A

The system of managing the order of JavaScript processes (event queue, callback queue, call stack)

18
Q

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

A

Non-blocking = code can run synchronously

Blocking = whatever is currently running on the call stack

**use DMV analogy for A-synchronization

19
Q

What is a directory?

A

A place where paths for files are kept

20
Q

What is a relative file path?

A

A way to get from where you currently are, to another place

21
Q

What is an absolute file path?

A

Starting from anywhere, always starts with root

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

writeFile()

24
Q

Are file operations using the fs module synchronous or asynchronous?

A

Both