Node Quiz Questions Flashcards

1
Q

What is Node.js?

A

Node.js is 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

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
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 (console.log is a REPL)

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

When was Node.js created?

A

In 2009 by Ryan Dahl

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

Java, ruby, php, python, c shark, c++, coval, objective c, go

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

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

around 400

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

To be aware if the request you sent actually sent. Your process might not be on, which is why the request isn’t working

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

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

It’s a global variable contained in the variable named process. So use the process variable to access it

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

an array

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

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

to export code to be used on other js pages

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

by calling the require function and passing in an argument of a filepath value

17
Q

What is a directory?

A

A folder for files

18
Q

What is a relative file path?

A

A path to a different file

19
Q

What is an absolute file path?

A

The whole file path

20
Q

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

A

fs module

21
Q

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

A

createWriteStream()
writeFile()
appendFile()

22
Q

Are file operations using the fs module synchronous or asynchronous?

A

They are both.