Node.js Flashcards
What is Node.js?
Program that allows JavaScript to run outside of a web-browser
What can Node.js be used for?
- Build back ends for web apps
- Command-line programs
- Any kind of automation that developers wish to perform
What is a REPL?
o Read-eval-print loop
o Interactive programming environment that takes single user inputs and executes them to return the result to the user (executed piecewise)
For example, the browser console
When was Node.js created?
2009
Back-end languages:
JavaScript Java Python PHP Ruby Go C++ C# (runs in .NET which is a framework)
What is a computer process?
Instance of a program running in a computer
Why should a full stack Web developer know that computer processes exist?
Because full stack web applications require multiple processes to work together concurrently for it to be useable (multiple processes have to be up and running to properly deal with the app’s clients, servers and databases)
What is the process object in a Node.js program?
Global object that provides information about/control over the current Node.js process
How do you access the process object in a Node.js program?
process
What is the data type of process.argv in Node.js?
Array of strings
What is a JavaScript module?
A single .js file
What values are passed into a Node.js module’s local scope?
o exports o require o module o \_\_filename o \_\_dirname
Give two examples of truly global variables in a Node.js program.
o console o process o Object o Undefined o global
What is the purpose of module.exports in a Node.js module?
How do you import functionality into a Node.js module from another Node.js module?
require(‘./filename’)