Node Flashcards

1
Q

What is a CLI?

A

Command Line Interface.
Its when you use receive commands from a user in the form of lines of text.

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

What is a GUI?

A

graphical user interface, is a form of user interface that allows users to interact through graphical interface, instead of text-based UIs

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

Give at least one use case for each of the commands listed in this exercise.
man
cat
ls
pwd
echo
touch
mkdir
mv
rm
cp

A

-man (manual command)
an interface to the system reference manuals
-cat: print out the text of a file
-ls: list directory contents
a : all
F : append indicator to entries
-pwd: print name of current/working directory
-echo: display a line of text
-touch
it indicates that we have interacted with the file and let you access the file
-mkdir: make new directories
-mv: move and rename files
-rm: remove files or directories
-cp: copy files and directories

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

What is Node.js?

A

Its basically JS but taking out of the browser. The syntax will be the same. Transferres for back end the functionalities of JS.

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

What can Node.js be used for?

A

Build back end for web application, any animation, server sites, command line programs

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

What is a REPL?

A

A Read-Eval-Print Loop, or REPL, is a computer environment where user inputs are read and evaluated, and then the results are returned to the user.

Its something that allows us to have a language running in the background. Ex: digita node no terminal e usa math, console…

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

What is a computer process?

A

Program being run in the memory.

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

The process object is a globally available object 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
9
Q

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

A

log process or require statement to import

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

an array

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

What is a JavaScript module?

A

js file thats a selfing closed collection of functionalities and can be easily imported into other files and used

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 and dir name

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 module and console module

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

Module exports tell Node. js which bits of code (functions, objects, strings, etc.) to export from a given file so that other files are allowed to access the exported code.

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

call the local require() function ex: 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

The controller who is in charge of what is being add to the call stack
The event loop is a constantly running process that monitors both the callback queue and the call stack.

17
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.

18
Q

What is a directory?

A

A directory is a location for storing files on your computer.

19
Q

What is a relative file path?

A

A relative path refers to a location that is relative to a current directory.

20
Q

What is an absolute file path?

A

An absolute path always contains the root element and the complete directory list required to locate the file.

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

hey are asynchronous but there are some methods are synchronous