Chapter 13: Modules

Learning Objectives

Upon completing all the content in this chapter, you should be able to do the following:

  1. Import external modules
  2. Create and import custom modules
  3. Explain why modules are useful for organizing and sharing code
  4. Use require to import modules
  5. Reference and use modules properties
  6. Install external Node mudules using npm
  7. Create a module and import it with another file in the same project
  8. 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

  1. Modules

Require Modules

  1. require
  2. relative path

NPM

  1. NPM

Exporting Modules

  1. export