module exports
Domenic Denicola
domenic at domenicdenicola.com
Fri Mar 14 06:22:07 PDT 2014
Have you ever used JavaScript module systems before? If so, the idea of a default export should be somewhat familiar…
> On Mar 14, 2014, at 6:31, "Mark Volkmann" <r.mark.volkmann at gmail.com> wrote:
>
> 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 options.
> 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 export.
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
More information about the es-discuss
mailing list