node.js Flashcards

1
Q

What is Node.js?

A

Node.js is a program that allows JavaScript to be run outside of a web browser. It is commonly used to build back ends 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
2
Q

What can Node.js be used for?

A

Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Event-driven means that the server only reacts when an event occurs. This allow us to create high performance, highly scalable, “real-time” 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. A simple interactive computer programming environment that takes single user inputs, executes them, and 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, Ruby, Java

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 or many threads. While a computer program is a passive collection of instructions, a process is the actual execution of those instructions.

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

150

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

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

The process object 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

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

an individuall 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

The values passed in the module wrapper: 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

global and process

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

export code from a file to allow use in a different file

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

module.exports & require

17
Q

What is the JavaScript Event Loop?

A

a que for the call back functions run by the web API. Once the call stack is empty it will process the items.

18
Q

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

A

blocking refers code that blocks other code from running

19
Q

What is a directory?

A

a file system cataloging structure which contains references to other computer files, and possibly other directories.

20
Q

What is a relative file path?

A

A relative path is a way to specify the location of a directory relative to another directory.

21
Q

What is an absolute file path?

A

An absolute path refers to the complete details needed to locate a file or folder, starting from the root element

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

asynchronous