Node JS Flashcards

1
Q

What is Node.js?

A

It is a JavaScript environment that allows you to run JavaScript 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

It can be used to run server applications, run command lines, program robots, etc.

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

What is a REPL?

A

Stands for Read-Eval-Print-Loop, and refers to a computer programming environment where user inputs are taken one line at a time, executed, and returned; a language shell

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 is a computer process?

A

An instance of a computer program that is being executed; a “task” in the task manager

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

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

A

We will be working with computer processes that appear in our “stack”

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

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

A

An object representing the current Node.js process that is being run

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

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

A

Using the variable process

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

What is a JavaScript module?

A

An individual .js file

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

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

A

It allows other files to import objects from the module

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

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

A

Using the require function require(‘relativeUrl.js’)

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

What is a directory?

A

A location that stores files and other directories

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

What is an absolute file path?

A

A file path starting with the root directory; starts with /

17
Q

What is a relative file path?

A

A file path that does not start with /, referring to a file based on it’s location relative to the current working directory

18
Q

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

A

fs

19
Q

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

A

.writeFile(file, data, callback)

20
Q

Are file operations using the fs module synchronous or asynchronous?

A

asynchronous