Node Flashcards
What is Node.js?
Node.js is a program that allows JavaScript to be run outside of a web browser.
It is commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform. Node.js is powered by V8; the same JavaScript engine in the Google Chrome browser.
What can Node.js be used for?
back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform
What is a REPL?
read–eval–print loop
simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user; a program written in a REPL environment is executed piecewise.
When was Node.js created?
2009 by Ryan Dahl
What back end languages have you heard of?
Ruby, PHP, Java, . Net, and Python
What is a computer process?
a process is the instance of a computer program that is being executed by one or many threads.
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
A lot
Why should a full stack Web developer know that computer processes exist?
What is the process object in a Node.js program?
The process object is a global that provides information about, the current Node.js process
How do you access the process object in a Node.js program?
global and provides information about, and control over, the current Node.js process.
It can also be explicitly accessed using require()
const process = require(‘process’);
What is the data type of process.argv in Node.js?
an array
What is a JavaScript module?
It’s a single .js file
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.
console object,
setInterval
process
global
What is the purpose of module.exports in a Node.js module?
to achieve modular programming. Modular programming refers to separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.