simpler, sweeter syntax for modules

Kevin Smith khs4473 at
Thu Mar 22 06:43:24 PDT 2012

Correct me if I have any of this wrong, but modules don't need to be
callable for the jQuery use case:

    // jquery.js
    export function $(...) { ... }

    // program.js
    import $ from "path/to/jquery.js";


We don't need "node style" modules-as-classes either:

    // MyClass.js
    export function MyClass() { ... }

    // program.js
    import MyClass from "MyClass.js";
    new MyClass;

or more succinctly:

    // program.js
    import * from "MyClass.js";
    new MyClass;

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

More information about the es-discuss mailing list