Node.js / NPM Flashcards
What is Node.js?
Node.js is a JavaScript runtime environment that executes JS code outside web browsers.
What can Node.js be used for?
Node.js is used for backend operations in JavaScript.
What is a REPL?
A Read-Eval-Print-Loop is a command-line tool for processing expressions.
What is a computer process?
An instance of a computer program being executed by one or many threads.
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
At least 200.
Why should a full stack Web developer know that computer processes exist?
It is an important concept in apps made up of multiple components such as clients, servers, and databases.
What is the process object in a Node.js program?
An object that represents the current instance of the node process being run.
How do you access the process object in a Node.js program?
process exists as a global variable.
What is the data type of process.argv in Node.js?
Array of strings.
What is a JavaScript module?
single .js file with a standalone function.
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, global
What is the purpose of module.exports in a Node.js module?
module.exports contains data that can be imported into other modules.
How do you import functionality into a Node.js module from another Node.js module?
const func = require(‘./func’);
What is the JavaScript Event Loop?
A design pattern that loops through the call stack and the callback queue, checking if the stack is empty and pushing functions onto it from the queue if it is.