ModuleImport
Michał Gołębiowski
m.goleb at gmail.com
Fri Jun 27 00:41:07 PDT 2014
On Thu, Jun 26, 2014 at 4:50 PM, Russell Leggett <russell.leggett at gmail.com>
wrote:
>
>
> //import a single named export
> import foo from "bar";
>
> //import multiple named exports
> import foo, baz from "bar";
>
> //alias an imported named export
> import foo as fooAlias from "bar";
>
> //import the module
> import "bar" as bar;
>
That would put a lot of Node modules exporting a single object/function at
a disadvantage. Compare:
```js
var mkdr = require('mkdirp');
```
to:
```js
import mkdirp as mkdr from mkdirp;
```
I like that the most common module usage can be done simpler.
--
Michał Gołębiowski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140627/5dcd1864/attachment.html>
More information about the es-discuss
mailing list