Node.js Flashcards
What is the purpose of module.exports in a Node.js module?
To export data from 1 js file to another
How do you import functionality into a Node.js module from another Node.js module?
require();
What is the javaScript Event Loop?
design pattern that waits for and dispatches events or messages
What is the different between blocking and non-blocking with respect to how code is executed?
blocking doesn’t allow other functions to execute
non-blocking does
What is a directory?
folder, collection of files
What is a relative file path?
paths relative to the current working directory
What is an absolute file path?
Complete directory list
What module does Node.js include for manipulating the file system?
File System
What method is available in the Node.js fs module for writing data to a file?
fs.writeFile
Are file operations using the fs module synchronus or asynchronous?
async
What is a client?
Request and receive services from a server
What is a server?
Provides functions or services
Which HTTP method does a browser issue to a web server when you visit a URL
GET
What is the first line of an HTTP request message?
Start line
http method
What is on the first line of an HTTP response message?
start-line
http method, status