News for hackers. Stuff that matters.
Re:JavaScript Modules by pmontra on Wednesday July 02, 2014 @03:24AM (#7975656)
The syntax is better than the CommonJS one. Check the side by side comparison at http://jsmodules.io/cjs.html However CommonJS is here now and JS engines might take a while to implement the new syntax. Example: the => (which is in the same ES6 draft) works in FF since version 22 and not in V8 yet. http://wiki.ecmascript.org/doku.php?id=harmony:specification...
Re:JavaScript Modules by 178 on Wednesday July 02, 2014 @07:42AM (#7976314)
That is not an honest comparison, though.

    import { getCodec } from "iconv-lite";
would be

    var getCodec = require("iconv-lite").getCodec;
Re:JavaScript Modules by couchand on Wednesday July 02, 2014 @08:23AM (#7976460)
Or in CoffeeScript,

    {getCodec} = require "iconv-lite"
Explicit dependencies without introducing new syntax? Yes, please.
Re:JavaScript Modules by cwmma on Wednesday July 02, 2014 @10:05AM (#7977016)
or in es6 var {getCodec} = require("iconv-lite");