node Flashcards

1
Q

What is Node.js?

A

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

build backend

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. Browser console is a REPL. interactive shell that processes node.js expressions.

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

When was Node.js created?

A

May 27th, 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

Python, PHP, Perl, JavaScript, Lua

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

500

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 Web development is based on making multiple processes work together to form one application. Important to know that application has many parts.

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. JavaScript object that is a model of Node Js computer 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

Just process because it is global

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 of strings

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. Modules are way to split an application into separate files instead of having all your application in one file. Allows you to establish values that you want to use on other modules.

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

__filename, __dirname, 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

console, process, url.

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

so that you can reuse that function in other modules. you are exporting that to somewhere else.

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

using require function and relative url to .

17
Q

What is the JavaScript Event Loop?

A

If the stack is empty, it takes the first task on the queue and pushes it on to the stack. System of managing JavaScript workloads. Looks to see if call stack is busy, if there is something in call stack does nothing. looks at queue stack and if there is a task, pushes that to call stack.

18
Q

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

A

Blocking refers to operations that block further execution until that operation finishes while non-blocking refers to code that doesn’t block execution. blocking means whatever is occupying the call stack (async). non-blocking means sync.

19
Q

What is a directory?

A

file system used to control how data is stored and retrieved. File that lists other files.

20
Q

What is a relative file path?

A

file path relative to the current file.

21
Q

What is an absolute file path?

A

full url to a file. file path starting from the root file to specific file.

22
Q

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

A

fs module

23
Q

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

A

js.writeFile

24
Q

Are file operations using the fs module synchronous or asynchronous?

A

asynchronous