Michał Gołębiowski m.goleb at
Fri Jun 27 00:51:08 PDT 2014

On Thu, Jun 19, 2014 at 4:04 PM, David Herman <dherman at> wrote:

> On Jun 19, 2014, at 3:31 AM, Michał Gołębiowski <m.goleb at> wrote:
> > Compare these 3 forms of importing all the module "lodash" bindings to
> an object _:
> > ```js
> > var _ = require("lodash"); // Node
> > import * as _ from "lodash"; // Dave's syntax
> > import "lodash" as _;
> > ```
> My feeling is that the clutter is small, and it's acceptable to have it be
> slightly less minimal than default export since that is the case we are
> favoring. This isn't so cluttered as to be downright *punishing*
> multi-export utility modules (it's literally only two characters longer
> than your Node code, albeit admittedly a little chattier), but it's good
> that default import is the winner.

IMO it's not even that much a question of taken space but of potential
confusion. People will think if they can do:
import * as _ from "lodash";
they can do:
import * from "lodash";
as well. Also, there are reports of thinking that the first form exports
not only the _ container object but also all individual methods as in

I'd still prefer:
import "lodash" as _;
I think it's less confusing that other proposals and reads naturally; it
also corresponds more to other module systems. But if that's out of the
picture, sth like:
import module _ from "lodash";
would be IMO less confusing that the proposed `* as _` form.

Michał Gołębiowski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list