Node.js Flashcards

1
Q

What is Node.js?

A

a program that allows JavaScript to be run outside of a web 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

building 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
3
Q

What is a REPL?

A

Read-Evaluate-Print-Loop : a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user (e.g: dev tools console, node REPL)

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

What is a computer process?

A

the instance of a computer program that is being executed by one or many threads - contains the programs code and activity
(a running instance of a computer program)

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

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

A

full stack web development is based on making multiple processes work together to form one application.
- some apps are made of multiple components such as clients, servers, and databases

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

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

A

a global object 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
7
Q

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

A

as a global object, it’s always available to Node.js applications.

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

What is the data type of process.argv in Node.js?

A

returns an Array of strings ( containing the command-line arguments passed when the Node.js process was launched)

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

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

A

exports, require, module, __filename, __dirname

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

What is a directory?

A

a special type of file that lists other files

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

What is a relative file path?

A

a file path relative to the current directory

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

What is an absolute file path?

A

the path to a file starting at the root

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

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

A

the fs module

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

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

A

fs.writeFile( )

17
Q

Are file operators using the fs module synchronous or asynchronous?

A

yes. both