Node General Flashcards
What is the purpose of module.exports in a Node.js module?
allows to specify which functions/variables should be exported to be used in other files
How do you import functionality into a Node.js module from another Node.js module?
require()
What is a directory?
Container that stores files and other directories
What is a relative file path?
Starts from the directory you’re in to your file
What is an absolute file path?
Starts from root all the way to your file
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
Are file operations using the fs module synchronous or asynchronous?
asynchronous