This proposal adds a new form of "export from" which exports another module's namespace exotic object as an exported name of another, filling a use case similar to the use cases for existing "export from" forms.
See the proposal repository for motivations and more information.
This proposal is closely related to the export default from proposal.
This spec proposal is written as a diff against the existing ECMAScript specification.
Export Statement Form | [[ExportName]] | [[ModuleRequest]] | [[ImportName]] | [[LocalName]] |
---|---|---|---|---|
export var v;
|
"v"
|
|
|
"v"
|
export default function f(){}
|
"default"
|
|
|
"f"
|
export default function(){}
|
"default"
|
|
|
"*default*"
|
export default 42;
|
"default"
|
|
|
"*default*"
|
export {x};
|
"x"
|
|
|
"x"
|
export {v as x};
|
"x"
|
|
|
"v"
|
export {x} from "mod";
|
"x"
|
"mod"
|
"x"
|
|
export {v as x} from "mod";
|
"x"
|
"mod"
|
"v"
|
|
export * from "mod";
|
|
"mod"
|
"*"
|
|
export * as ns from "mod";
|
|
"mod"
|
"*"
|
"ns"
|
"*"
, [[LocalName]]: With parameter module.