import script --> .esm

Kevin Smith zenparsing at
Wed Sep 10 10:23:08 PDT 2014

> In NodeJS, this can be through `package.json` properties which inform what
> module format the package is.

Right - although having a runtime system looking at json config files is a
terrible idea.  : )  In es6now, I'm experimenting with the following rule:

- If some folder that might be a "package" contains a "default.js" file,
then load it as an ES6 module/package.
- Otherwise, use the old-school algorithm (package.json or index.js).

In any case, it makes sense (when possible) to make the module vs. script
decision at package boundaries.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list