Node.js Flashcards
What is Node.js?
a program that allows JavaScript to be run outside of a web browser
What can Node.js be used for?
to build 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
When was Node.js created?
2009
What back end languages have you heard of?
C#, Ruby, PHP, Java, JavaScript, SQL, and Python
What is the process object in a Node.js program?
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?
As a global you can just reference it. It can be explicitly accessed using require()
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?
exports, require( ), module, __filename, __dirname
Give two examples of truly global variables in a Node.js program.
console, process
What is the purpose of module.exports in a Node.js module?
Module exports are the instruction that tells Node. js which bits of code (functions, objects, strings, etc.) to “export” from a given file so other files are allowed to access the exported code.
How do you import functionality into a Node.js module from another Node.js module?
use require function
const variable = require(./relativeFilePath )
What is a directory?
folder
What is a relative file path?
A path to a file based of the current location