Games Node.js Module Maze

Module Maze

require, the module cache, exports, circular requires, import hoisting and top-level await.

0 / 8 levels · 0 / 24 ★Start playing ›
  1. Module Maze

    Modules are books in a library. The first require reads the book cover to cover and puts it on the 'already read' shelf. Every later require gets the same copy from the shelf without reading it again. ESM is a library that fetches every book you will need before you read a single page.

Your rulebook

Finish a level to add its rule. Fill the book and you can explain all of this in an interview.

  1. 1Finish A module runs once to unlock this rule.
  2. 2Finish require() waits for the whole file to unlock this rule.
  3. 3Finish exports = {} goes nowhere to unlock this rule.
  4. 4Finish Circular requires see half a book to unlock this rule.
  5. 5Finish Imports go first to unlock this rule.
  6. 6Finish ESM imports are live to unlock this rule.
  7. 7Finish CommonJS hands you a copy to unlock this rule.
  8. 8Finish Top-level await holds the importer to unlock this rule.