Node Flashcards
What is Node.js?
A program that allows javascript code to run outside of a web browser
What can Node.js be used for?
websites and backend services
What is a REPL?
(Read Eval Print Loop) is the environment where code can be executed
What is a computer process?
The actual execution of a program; a process is an instance of a program
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
hundreds
What is the process object in a Node.js program?
global object that provides information about the current node.js process
How do you access the process object in a Node.js program?
use the global name process
What is the data type of process.argv in Node.js?
array
What is a JavaScript module?
a .js file in node.js
What values are passed into a Node.js module’s local scope?
exports, require, module, __filename, __dirname
Give two examples of truly global variables in a Node.js program.
process, console
What is the purpose of module.exports in a Node.js module?
a way to send data from one module(js file) to another
How do you import functionality into a Node.js module from another Node.js module?
using the require function
What is the JavaScript Event Loop?
it runs asynchronous code separate from the call stack that does not block the normal flow of code
What is different between “blocking” and “non-blocking” with respect to how code is executed?
blocking is code that prevents further code from running until the current task is completed, non-blocking is asynchronous