node-require Flashcards

1
Q

What is the purpose of module.exports in a Node.js module?

A

To pass anything to the require object which can be accessed by their relative path from another module.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you import functionality into a Node.js module from another Node.js module?

A

Calling the require object and passing one argument of a string containing a period then a relative path to the module.exports property in the other file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly