Node.js Flashcards
What is Node.js?
a JavaScript runtime build on Chrome’s V8 JavaScript engine
What can Node.js be used for?
its used for backend and command line scripts
What is a REPL?
Read, Evaluate, Print, Loop
What is the process object in a Node.js program?
The process object is a global that provides information about, and control over, the current Node.js process
How do you access the process object in a Node.js program?
reference it
What is the data type of process.argv in Node.js?
Array of strings
What is a JavaScript module?
a file that contains related code
What values are passed into a Node.js module’s local scope?
exports, require, filename, dirname
Give two examples of truly global variables in a Node.js program.
process, global
What is the purpose of module.exports in a Node.js module?
To export a piece of code so other files are able to access it
How do you import functionality into a Node.js module from another Node.js module?
you add module.exports to whatever code you want to export and then require method to where you want to use it
What is the JavaScript Event Loop?
a runtime model that is responsible for executing code, collecting and processing events and executing queued sub-tasks.
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 special file that lists other files and directories
What is a relative file path?
relative file path tells you how to get to a file from your current location