Node Flashcards
What is Node.js?
A program that allows Js to be run outside of a browser.
What can Node.js be used for?
Build backend
What is a REPL?
read-eval-print loop. Programming environment.
When was Node.js created?
May 27, 2009
What back end languages have you heard of?
Python, Ruby, PHP
What is a computer process?
A computer program being executed by one or many threads.
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
500
Why should a full stack Web developer know that computer processes exist?
To know if their programs instructions can be executed.
What is the process object in a Node.js program?
A global object that provides info and 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?
exports, require, module, __filename, and __dirname.
Give two examples of truly global variables in a Node.js program.
Process, console
What is the purpose of module.exports in a Node.js module?
adds it to the root of the module to be used in other module.
How do you import functionality into a Node.js module from another Node.js module?
require(‘filepath’)
What is a directory?
Group of files
What is a relative file path?
A specific location in a file system relative to the directory you are working in .
What is an absolute file path?
The same location in a file system relative to the root directory.
What module does Node.js include for manipulating the file system?
File system module.
What method is available in the Node.js fs module for writing data to a file?
writeFile method
Are file operations using the fs module synchronous or asynchronous?
asynchronous and synchronous
What is the JavaScript Event Loop?
Code that sits in a call stack until its time to be queued, then executed once the stack is cleared.