node-require Flashcards
1
Q
What is the purpose of module.exports in a Node.js module?
A
To export code into another module
2
Q
How do you import functionality into a Node.js module from another Node.js module?
A
Use the require function and pass in the relative path of the file as a string, then you can assign it to a variable