Node.js Flashcards
What is Node.js?
An asynchronous event-driven JavaScript runtime, Node.js is a program that allows JavaScript to be run outside of a web browser.
What can Node.js be used for?
Build back ends for Web applications, command-line programs, or any kind of automation
What is a REPL?
A Read-Eval-Print-Loop (REPL) reads input from the user, executes them, and returns the result to the user.
When was Node.js created?
2009
What back end languages have you heard of?
PHP, Ruby on Rails, C#, Java
What is a computer process?
The execution of code/program/application by one or more threads
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
hundreds
Why should a full stack Web developer know that computer processes exist?
Full stack is made up of many modules. To track the status of the server, check its pid.
What is the process object in a Node.js program?
Global variable with information about and control over the current Node.js process.
How do you access the process object in a Node.js program?
process variable
What is the data type of process.argv in Node.js?
Array of strings
What is a JavaScript module?
JavaScript file
What values are passed into a Node.js module’s local scope?
dirname, filename, exports, required
Give two examples of truly global variables in a Node.js program.
process, argv, console
What is the purpose of module.exports in a Node.js module?
Allows you to write modular code and easily reuse it by importing and exporting.
How do you import functionality into a Node.js module from another Node.js module?
Use require.