Node Module System & Node Require Flashcards
1
Q
What is a JavaScript module?
A
A single .js file
2
Q
What values are passed into a Node.js module’s local scope?
A
exports, require, module, __filename, __dirname
3
Q
Give two examples of truly global variables in a Node.js program.
A
Process and global
4
Q
What is the purpose of module.exports in a Node.js module?
A
To export code into another module
5
Q
How do you import functionality into a Node.js module from another Node.js module?
A
Require( ) and pass in the relative path of the file as a string