Chapter 13: Modules
Learning Objectives
Upon completing all the content in this chapter, you should be able to do the following:
- Import external modules
- Create and import custom modules
- Explain why modules are useful for organizing and sharing code
- Use
require
to import modules - Reference and use modules properties
- Install external Node mudules using
npm
- Create a module and import it with another file in the same project
- Use the
module.exports
object to expose modules properties
Key Terminology
Here is a list of key terms for this chapter broken down by the page the term first appears on. You should make note of these terms and their definitions.
What are Modules
- Modules
Require Modules
require
- relative path
NPM
- NPM
Exporting Modules
- export