node.js Flashcards
What is Node.js?
A server environment
What can Node.js be used for?
web-servers, application-servers, desktop-programs, mobile-apps
What is a REPL?
Read, evaluate, print, loop
What is a computer process?
environment where code runs
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
250+
Why should a full stack Web developer know that computer processes exist?
To find out if stuff is running
What is the process object in a Node.js program?
How do you access the process 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 file that can be exported and used in other files
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, console
What is different between “blocking” and “non-blocking” with respect to how code is executed?
Blocked: stops all code until the current function is finished running.
Non-blocking: running things asynchronously
What module does Node.js include for manipulating the file system?
fs
What method is available in the Node.js fs module for writing data to a file?
writeFile