nodejs Flashcards
What is Node.js?
open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser
What can Node.js be used for?
executing javascript code outside of the web browser
What is a REPL?
read-eval-print loop and basically provides a programmer with an interactive programming environment
When was Node.js created?
May 27, 2009
What back end languages have you heard of?
node.js
What is a computer process?
instance of a computer program being executed by one or more threads
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
529 processes, 2079` threads
Why should a full stack Web developer know that computer processes exist?
web dev is based on making multiple processes work together to form one application
What is the process object in a Node.js program?
global 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?
process object or using require, i.e.,
the process object itself:
console.log(process)
or
assigning a variable to the require method of the object: const process = require('process') console.log(process)
What is the data type of process.argv in Node.js?
string
What is a JavaScript module?
a single js file, i.e., splitting JavaScript programs up into separate “modules” that can be imported when needed
What values are passed into a Node.js module’s local scope?
Variables local to the module will be private, because the module is wrapped in a function by Node.js (see module wrapper)
filename, dirname
Give two examples of truly global variables in a Node.js program.
exports, require
What is the purpose of module.exports in a Node.js module?
exports a file, i.e.,
module.exports.hello = () => { return ‘hello’; }