Node Flashcards

1
Q

What is Node.js?

A

JavaScript that can run outside the 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

To use JS on back-end (server-side)

command line

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

Read what you want to type, evaluate it, print result, do it again

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

What is a computer process?

A

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
5
Q

Roughly how many computer processes are running on your host operating system?

A

A lot

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

full stack web dev relies on making multiple processes work together to form an app. Need to be aware of what processes are in order to understand the multiple components of full stack web dev (clients, servers, databases)

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

global object that provides info about and control over the current Node.js process

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

It’s always available in Node

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

An array of strings

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

What is a JavaScript module?

A

In Node.js, each js file is considered a separate module

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

can assign functionality you want to return 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

require( )

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

fs (File System 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

writeFile(fileName, data, [options], callback)

17
Q

Are file operations using fs module synchronous or asynchronous?

A

asynchronous