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, 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 →
Related concepts
- import/export syntaxkind of · Module import and export syntax declares dependencies between modules and makes selected bindings available to other modules.
- modulepart of · A module is a distinct, bounded software unit that groups related code or functionality and provides an organizational or interaction boundary within a larger system.
- import statementused by · An import statement is a source-code declaration that makes names or definitions from another module, package, or namespace available in the current scope.
- exportkind of · An export is a JavaScript module declaration that makes bindings available to other modules.
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.

