JavaScript Modules

Splitting Code into Files with import and export

Real-world programs are too large to fit in one file. Modules let you split code into separate, self-contained files that can share functionality with each other. Work through the pages below in order.

  1. Intro to Modules
  2. Import and Export in More Detail
  3. Importing Modules from the Internet
  4. Node.js and CommonJS