Named export
A named export is a module binding made available under an explicit name that importing code can reference, with optional renaming.
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
A module export that is made available under an explicit name and must be imported by that name unless renamed.
- How it is used
- Uses named exports to make several module values available under distinct names that importers can select.
- How deep it goes
- Explains declaration and brace-list syntax, export aliases, matching imports, and top-level placement without descending into module internals.
- Examples
- Shows currency and number formatters, product-detail formatting, and aliases that avoid conflicting import names.
- What you can do after
- Build it from scratch by exporting multiple declarations, importing selected names, and renaming an import when needed.
Secrets of the JavaScript Ninja, Third Edition
A named export is a module export identified by a name that importers can reference explicitly.
- How it is used
- Exposes individually selectable values across ESM modules.
- How deep it goes
- Works through declaration, import aliases, and live bindings, with practical import-path caveats rather than a module-resolution algorithm.
- Examples
- Uses paired export-and-import files and a dice-roll module whose exported value changes.
- What you can do after
- Build it from scratch by exporting named values, importing them with optional aliases, and reading updated bindings.
Read how Secrets of the JavaScript Ninja, Third Edition explains named export →
Secrets of the JavaScript Ninja, Second Edition
An exported module binding identified by its declared or explicitly assigned name, allowing a module to expose multiple bindings.
- How it is used
- Exposes selected module bindings for use by importing code while keeping unexported top-level variables inaccessible.
- How deep it goes
- Shows declaration and export-list syntax, named imports, aliases, and namespace imports without exploring runtime internals.
- Examples
- Uses a Ninja module that exports a greeting message and function while keeping its ninja variable private.
- What you can do after
- Apply named-export syntax to expose selected bindings and import them by name or through a module namespace.
Read how Secrets of the JavaScript Ninja, Second Edition explains named export →
Also covered in
- React Hooks in Action: With Suspense and Concurrent Mode
- Vanilla WebIn early access (MEAP)
- Essential TypeScript 5, Third Edition
What to know first
- moduleA module is a cohesive unit of code or computation that groups related functionality within a larger system and defines a scope or boundary for organizing or sharing it.
Related concepts
- ECMAScript moduleused by · An ECMAScript module is a separately scoped JavaScript unit whose dependencies and shared bindings are declared with import and export syntax.
- import/export syntaxkind of · Module import and export syntax declares dependencies between modules and makes selected bindings available to other modules.
- export keyworduses · An export keyword marks a declaration or value for availability outside its defining module or program.
- modulepart of · A module is a cohesive unit of code or computation that groups related functionality within a larger system and defines a scope or boundary for organizing or sharing it.
- exportkind of · An export is a JavaScript module declaration that makes bindings available to other modules.
- import statementused by · An import statement is a source-code declaration that makes definitions from another module, package, or namespace available in the current program context.
Questions about named export
What is named export?
A named export is a module binding made available under an explicit name that importing code can reference, with optional renaming.
Which Manning books explain named export?
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond, Secrets of the JavaScript Ninja, Third Edition and Secrets of the JavaScript Ninja, Second Edition.
What should I know before learning named export?
Manning books that teach named export usually introduce module first.
What is named export a kind of?
Named export is a kind of import/export syntax. Module import and export syntax declares dependencies between modules and makes selected bindings available to other modules.
What is named export part of?
Named export is part of module. A module is a cohesive unit of code or computation that groups related functionality within a larger system and defines a scope or boundary for organizing or sharing it.
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.


