Node Flashcards

1
Q

What is Node.js?

A

A program that allows Js to be run outside of 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

Build backend

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. Programming environment.

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

When was Node.js created?

A

May 27, 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

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 by one or many threads.

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

500

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

To know if their programs instructions can be executed.

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 global object that provides info 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

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 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 single Js 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, and __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, 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

adds it to the root of the module to be used in other module.

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(‘filepath’)

17
Q

What is a directory?

A

Group of files

18
Q

What is a relative file path?

A

A specific location in a file system relative to the directory you are working in .

19
Q

What is an absolute file path?

A

The same location in a file system relative to the root directory.

20
Q

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

A

File system module.

21
Q

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

A

writeFile method

22
Q

Are file operations using the fs module synchronous or asynchronous?

A

asynchronous and synchronous

23
Q

What is the JavaScript Event Loop?

A

Code that sits in a call stack until its time to be queued, then executed once the stack is cleared.