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./ as a back end api/ to make programs that run on the command line/ or any desktop program/ almost any area of programming

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 (REPL),
is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user another existing tool would be an ineractive coding inviroment like the chrome console.

node js can be ran as a REPL in ineractive mode

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

When was Node.js created?

A

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

python,Java,c++

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(copy) of a computer program that is being executed by one or many threads(a program that is bein runned)

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

7

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, This will be extremely important when learning about applications made of multiple components, such as clients, servers, and databases.

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 object 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().

it has many events that can be used to

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 can also be explicitly accessed using require():

and it is always available to Node.js applications without using require(). I

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

array with string elements

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

What is a JavaScript module?

A
  1. In JavaScript, a “module” is a single .js file.

2. they each have module scope meaning its data is only available within that module

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

exports/required/moduele/___filename/___dirname

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

What is a JavaScript module?

A

A module in JavaScript is just a file containing related code.

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

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

A

process/ console/ setTimeout

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

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

A

The export statement is used when you want to house the things that are ,ade available to other modules like functions objects variables etc.

17
Q

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

A
that can be with both require for the common js method require  
var exampleBlah = require('./example.js')

and import but thats for module 3, it was not available to node until later on

18
Q

What is the JavaScript Event Loop?

A

the event loop is the loop that passes whatever is in the event que into the stack once the after the stack is empty

19
Q

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

A

blocking is any code that blocks further execution until that operation is completed, while none blocking does not block other executions

20
Q

What is a directory?

A

its a folder that houses the list of file names that it contains and it points to those individual files

21
Q

What is a relative file path?

A

it is a path to a file relative to the current directory/folder that starts with just its name
EXAMPLE: somedirectory/someotherfile.js

22
Q

What is an absolute file path?

A

the entire URL to a file from the root of the file system it starts with a /
EXAMPLE: /HOME/USERNAME/SOMEDIRECTORY/SOMEFILE.JS

23
Q

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

A

the ‘fs’ module

24
Q

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

A

writeFile method

25
Q

Are file operations using the fs module synchronous or asynchronous?

A

asynchronous