Node Flashcards
What is a CLI?
Command Line Interface.
Its when you use receive commands from a user in the form of lines of text.
What is a GUI?
graphical user interface, is a form of user interface that allows users to interact through graphical interface, instead of text-based UIs
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
-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
What is Node.js?
Its basically JS but taking out of the browser. The syntax will be the same. Transferres for back end the functionalities of JS.
What can Node.js be used for?
Build back end for web application, any animation, server sites, command line programs
What is a REPL?
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…
What is a computer process?
Program being run in the memory.
What is the process object in a Node.js program?
The process object is a globally available object that provides information about, and control over, the current Node.js process.
How do you access the process object in a Node.js program?
log process or require statement to import
What is the data type of process.argv in Node.js?
an array
What is a JavaScript module?
js file thats a selfing closed collection of functionalities and can be easily imported into other files and used
What values are passed into a Node.js module’s local scope?
exports, require, module, filename and dir name
Give two examples of truly global variables in a Node.js program.
process module and console module
What is the purpose of module.exports in a Node.js module?
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 do you import functionality into a Node.js module from another Node.js module?
call the local require() function ex: const add = require(‘./add’);
What is the JavaScript Event Loop?
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.
What is different between “blocking” and “non-blocking” with respect to how code is executed?
Blocking refers to operations that block further execution until that operation finishes while non-blocking refers to code that doesn’t block execution.
What is a directory?
A directory is a location for storing files on your computer.
What is a relative file path?
A relative path refers to a location that is relative to a current directory.
What is an absolute file path?
An absolute path always contains the root element and the complete directory list required to locate the file.
What module does Node.js include for manipulating the file system?
fs module
What method is available in the Node.js fs module for writing data to a file?
fs.writeFile
Are file operations using the fs module synchronous or asynchronous?
hey are asynchronous but there are some methods are synchronous