Node.js Flashcards

1
Q

What is Node.js?

A

Javascript engine that allows you to run Javascript outside of the 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

Used to build network applications (like a server) but also any applications (NASA rover programmed with Node)

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 programming environment that takes single user inputs, executes them, and returns the result to the user. Basically a little playground environment to learn and test things

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

PHP, Python, C++, GoLang

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

What is a computer process?

A

The instance of a computer program that is being executed by one of many threads. A process contains the program code and its activity.

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

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

A

Our websites, apps, and/or servers will have more than one process occurring so we should know enough about processes to make our projects work correctly.

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

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

A

Gives information on whatever the current process running in Node.js is

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

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

A

Using process

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

What is a JavaScript module?

A

A single .js file

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

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

A

Require, exports, module, _dirname, and _filename

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

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

A

To be able to use methods/variables in other JS files

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

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

A

When you write the export on the first file you make a variable on the second file that calls the file path with require.

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

What is the JavaScript Event Loop?

A

The stack of events, procedures that Java has to run

17
Q

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

A

Blocking executes synchronously. The execution of additional Javascript in the Node.js process must wait until a non-Javascript operation completes.
Non blocking is asynchronous.

18
Q

What is a directory?

A

A folder that holds files and folders

19
Q

What is a relative file path?

A

The path from the current file to the destination file

20
Q

What is an absolute file path?

A

The path from the beginning of the hard drive to whatever the destination file is

21
Q

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

A

Fs (file system module)

22
Q

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

A

Writefile

23
Q

Are file operations using the fs module synchronous or asynchronous?

A

Asynchronous