Node 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; a program written in a REPL environment is executed piecewise.

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 back end languages have you heard of?

A

JavaScript, Java, PHP, Python, Ruby, C#, SQL, C++, C, Rust,

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. It contains the program code and its activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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
To know what is involved for an application to run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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. As a global, it is always available to Node.js applications without using ‘require()’.

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

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

A

It’s global, it’s there and you can always access it?

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

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

A

Array of strings

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

What is a JavaScript module?

A

A single ‘.js’ file; The important part is file.

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

Give two examples of truly global variables in a Node.js program.

A

process and global

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

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

A

Pick and choose what is available to other modules

To export functionality from one Node.js module to another Node.js module.

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

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

A

require function

const add = require(‘./add’);

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

What is the JavaScript Event Loop?

A

Look at call stack and task/callback queue, if stack empty, pushes first task/callback queue to call stack.

17
Q

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

A

blocking: code that is slow, on browser, prevents any other action while code is running.
non-blocking: asynchronous callbacks, it is run later?

18
Q

What is a directory?

A

A file system structure containing files and other directories; groups files together

19
Q

What is a relative file path?

A

location that is relative to current directory

path to file within same directory: file name

20
Q

What is an absolute file path?

A

contains the root element and the complete directory list to the file
path to file from the root directory to file name

21
Q

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

A

fs module

22
Q

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

A

fs.writeFile()

23
Q

Are file operations using the ‘fs’ module synchronous or asynchronous?

A

Both asynchronous and synchronous forms