node Flashcards
What are the 3 components of a full stack Web architecture?
presentation, logic, and data
What is Node.js?
an asynchronous event-driven JavaScript runtime for the back end
What can Node.js be used for?
to build scalable network applications
What is a REPL?
read-eval-print loop
When was Node.js created?
2009
What backend languages have you heard of?
python, php, ruby, C sharp, Java, C++
What is a computer process?
Why should a full stack Web developer know that computer processes exist?
What is the process object in a Node.js program?
How do you access the process object in a Node.js program?
process is a global object so to access it just
What is the data type of process.argv in Node.js?
always strings
How do you access the command line arguments in a Node.js program?
process.argv[2] or const [ , , …message ] = process.argv;
console.log(message.join(‘ ‘));
What is a JavaScript module?
a file that has JavaScript code in it.
What are the advantages of modular programming?
keeps the code small, succinct and easy to understand
In JavaScript, how do you make a function in a module available to other modules?
you export it using the keyword export
In JavaScript, how do you use a function from another module?
you import it using the keyword import
What is the JavaScript Event Loop?
What is different between “blocking” and “non-blocking” with respect to how code is executed?
“blocking” code is executed synchronously, while “non-blocking” code is executed asynchronously
What is a directory?
a folder
What is a relative file path?
a file in the same directory
What is an absolute file path?
always starts with a “/”
What module does Node.js include for manipulating the file system?
What method is available in the node:fs module for reading data from a file?
What method is available in the node:fs module for writing data to a file?
writeFile() method
Are file operations using the fs module synchronous or asynchronous?
asynchronous because file operations are slow to avoid blocking the process.