Module Comments

Axel Rauschmayer axel at
Thu Dec 6 07:31:54 PST 2012


Compared to Node.js, I love ES6 exports, but Node.js module imports are easier to understand.

Claus’ suggestion would make `import` similar to `let` and people could basically think of modules as objects.

On Dec 6, 2012, at 10:41 , Claus Reinke <claus.reinke at> wrote:

>> Well, the thing is it isn't consistent with the destructuring meaning: dropping the curlies here means extracting a single export (aka property), which is not what it means in destructuring assignment/binding anywhere else.
>> But that said, the convenience may well still trump the inconsistency.
> I think I'd prefer consistency here, as it also allows to get rid of
>   import "foo" as foo;
> and replace it with
>   import foo from "foo";
> which keeps the order of
>   import {x,y} from foo
> and it is all just module-level destructuring (fewer new concepts).

Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list