liveBook · Manning

Named export

A named export is a module binding made available under an explicit name that importing code can reference, with optional renaming.

How 2 Manning books explain it

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.

Read how Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond 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 →

Related concepts

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.