Node.JS Flashcards
What is Node.js?
A JavaScript runtime
What can Node.js be used for?
is used to execute JavaScript outside of the browser
What is a REPL?
Read Eval Print Loop. a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user
What is a computer process?
A program that is running on your computer
What is the process object in a Node.js program?
that provides information about, and control over, the current Node.js process.
How do you access the process object in a Node.js program?
by name, its always there.
What is the data type of process.argv in Node.js?
an array of strings.
What is a JavaScript module?
a single file that should preform a specific task
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 object and console.
What is the purpose of module.exports in a Node.js module?
to be able to send data to other modules
How do you import functionality into a Node.js module from another Node.js module?
using the require method. ex require(‘./add’)
What module does Node.js include for manipulating the file system?
the fs module
What does express.static() return?
a middleware function that probably has all the contents of a specified file
What is the local __dirname variable in a Node.js module?
it provides the absolute path to the current directory