# JavaScript Level 7: Modules & Code Organisation

> Level 7: Modules & Code Organisation of the LoWisa JavaScript course: ES Modules, Imports, Exports and Dependencies, Designing Maintainable Modules. 3 lessons and 9 ideas, each explained in one line.

Modules & Code Organisation is level 7 of 16 of the [LoWisa JavaScript course](/courses/javascript/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## ES Modules

- **Modules.** A **module** is one file with its own top-level scope: nothing leaks out unless the file exports it.
- **export.** The **export** keyword marks what a file offers: named exports for several values, default for the file’s one main thing.
- **import.** The **import** statement pulls another module’s exports into scope, and the engine loads each module exactly once.

## Imports, Exports and Dependencies

- **Dependency graphs.** Imports form a **graph**: the entry file names what it needs, those files name theirs, and the loader walks it all.
- **Circular imports.** Two modules importing each other create a **cycle**, which loads but can hand one side half-initialised values.
- **Packages.** A **package** is a published folder of modules with a name and version, installed into node_modules and imported by name.

## Designing Maintainable Modules

- **Single purpose.** A maintainable module has **one** job you can state in a sentence: parsing dates, talking to the orders API.
- **Small surfaces.** Export the minimum: every extra name is **surface** other code will grip, making later change harder.
- **Layering.** Point dependencies one way: interface code may import data code, never the **reverse**: and cycles stop appearing.

## Before and after this level

- **Before:** [Level 6: Objects & Prototypes](/courses/javascript/level-6-objects-and-prototypes/): Prototypes and Prototype Chains, Classes and Object-Oriented JavaScript, Composition and Encapsulation.
- **Next:** [Level 8: Errors & Debugging](/courses/javascript/level-8-errors-and-debugging/): Exceptions and Error Handling, Debuggers and Stack Traces, Defensive JavaScript.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does JavaScript Level 7: Modules & Code Organisation cover?

ES Modules, Imports, Exports and Dependencies, Designing Maintainable Modules: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 6: Objects & Prototypes, which covers Prototypes and Prototype Chains, Classes and Object-Oriented JavaScript, Composition and Encapsulation.

## Learn JavaScript on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/javascript/level-7-modules-and-code-organisation/ · Updated 2026-11-16
