Node.js Flashcards
What is Node.js?
Node.js is a program that allows JavaScript to be run outside of a web browser.
What can Node.js be used for?
It is commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.
What is a REPL?
REPL also known as Read Evaluate Print Loop is a programming language environment (basically a console window) that takes single expression as user input and returns the result back to the console after execution.
When was Node.js created?
2009 by Ryan Dahl
What back end languages have you heard of?
Ruby, PHP, Java, .Net, Python
What is the process object in a Node.js program?
The process object is a global that provides information about, and control over, the current Node.js process.
How do you access the process object in a Node.js program?
Just reference it. As a global, it is always available to Node.js applications without using require().
What is the data type of process.argv in Node.js?
An array of strings
What is a JavaScript module?
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.
Process and global
What is the purpose of module.exports in a Node.js module?
To export code into another module
How do you import functionality into a Node.js module from another Node.js module?
use require() and use relative path as a string argument.
What is a directory?
Also called folders
What is a relative file path?
Relative file path to current directory (doesn’t start with a slash)