module exports

Mark Volkmann r.mark.volkmann at
Fri Mar 14 03:31:21 PDT 2014

I'm trying to understand the options for exporting things from a module.
Here's how I think it works, mostly based on what I see in Traceur.
Does any of this look wrong?

To export a value,
export var someName = someValue;

To export a function,
export function someName(args) { ... };

To export multiple things defined elsewhere in this file,
export {name1, name2, ...};

Here's the part that confuses me most. It seems that importers have three
1) import specific things from a given module
2) import everything that was exported from a given module
3) import a subset of what a given module exports that it identified as the
"default" (presumably the most commonly used things)

To define the default subset of things to export from a module,
export default = some-value or some-function;
where some-value could be an object holding a collection of things to

R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list