Node Flashcards

1
Q

What is Node.js?

A

-Asynchronous event-driven JavaScript runtime

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 scalable network applications

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

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

When was Node.js created?

A

-Node.js was initially released on 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

-C, C++, Java, Ruby, PHP, Python

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

What is a computer process?

A

-Process is the instance of a computer program that is 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

-120

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 development is based on making multiple processes work together to form one appliation

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

-global that provides information about, and control over, the currnet 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.argv

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

-Each js file is treated as a module

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
  • exports
  • module
  • require()
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

- global

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

-Tells Node.js which bits of code to export from a given file so other modules have access to the exported code

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()

17
Q

What is the JavaScript Event Loop?

A

-If the stack is empty, it takes the first item on the queue and pushes to the stack

18
Q

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

A

-Blocking refers to operations that block further execution until that operation finishes while non-blocking refers to code that doesn’t block execution

19
Q

What is a directory?

A

-Location for storing files on computers

20
Q

What is a relative file path?

A

-A relative path needs to be combined with another path in order to access a file

21
Q

What is an absolute file path?

A

-An absolute path always contains the root element and the complete directory list required to locate the file

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 asynchronous and synchronous