ECMAScript module
An ECMAScript module is a separately scoped JavaScript unit whose dependencies and shared bindings are declared with import and export syntax.
Secrets of the JavaScript Ninja, Third Edition
A JavaScript module whose dependencies and shared bindings are declared using standardized import and export syntax.
- How it is used
- Organizes JavaScript into self-contained files with explicit dependencies instead of ordered scripts and shared globals.
- How deep it goes
- Explains export forms, live bindings and import timing, then traces specifier resolution to runtime-specific configuration.
- Examples
- Uses a Node.js calculator, a package with root and subpath exports, and an HTML import map.
- What you can do after
- Operate/configure ESM in Node.js packages and browser pages, choosing static or runtime imports and recognizing CommonJS compatibility pitfalls.
Read how Secrets of the JavaScript Ninja, Third Edition explains ECMAScript module →
Vanilla Web
An ECMAScript module is a separately scoped JavaScript module with explicit import and export bindings.
- How it is used
- Organizes browser application logic and distributes small libraries or custom elements without requiring a framework.
- How deep it goes
- Explains scope, graph construction, linking, live bindings, single evaluation, exports, and side-effect control; only names advanced loading options.
- Examples
- Uses named and default exports, a module-script entry, a custom-element distribution file, and a legacy fallback.
- What you can do after
- Build it from scratch as browser-loaded files with explicit imports and exports, while controlling initialization and checking compatibility.
What to know first
- JavaScriptJavaScript is a high-level, dynamically typed programming language standardized as ECMAScript and used for web and general-purpose programming.
- TypeScriptTypeScript is a statically typed superset of JavaScript that adds type-system features and is compiled to JavaScript.
Related concepts
- default exportuses · A default export is the module export designated for import as the module’s default, without requiring a matching exported name.
- live bindinguses · A module binding that remains connected to its original variable so that updates to the variable are reflected wherever the binding is accessed.
- named exportuses · A named export is a module binding made available under an explicit name that importing code can reference, with optional renaming.
- CommonJSalternative to · CommonJS is a JavaScript module-system specification that defines how modules export and load values, traditionally using synchronous require calls and module.exports assignments.
Questions about ECMAScript module
What is ECMAScript module?
An ECMAScript module is a separately scoped JavaScript unit whose dependencies and shared bindings are declared with import and export syntax.
Which Manning books explain ECMAScript module?
Secrets of the JavaScript Ninja, Third Edition and Vanilla Web.
What should I know before learning ECMAScript module?
Manning books that teach ECMAScript module usually introduce ECMAScript 2015, JavaScript and TypeScript first.
What is the difference between ECMAScript module and CommonJS?
An ECMAScript module is a separately scoped JavaScript unit whose dependencies and shared bindings are declared with import and export syntax. CommonJS is a JavaScript module-system specification that defines how modules export and load values, traditionally using synchronous require calls and module.exports assignments.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

