Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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...


That is not an honest comparison, though.

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

    var getCodec = require("iconv-lite").getCodec;


Or in CoffeeScript,

    {getCodec} = require "iconv-lite"
Explicit dependencies without introducing new syntax? Yes, please.


or in es6 var {getCodec} = require("iconv-lite");




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: