Node.js plans to support import/export ES6 (ECMAScript 2015) modules

I’ve been looking all over the Internet without a clear answer for this. Currently Node.js uses only CommonJS syntax to load modules, and if you really want to use the standard ECMAScript 2015 modules syntax, you either have to transpile it beforehand or use an external module loader at runtime. Currently I’m not too positive … Read more

Is it possible to import modules from all files in a directory, using a wildcard?

With ES6, I can import several exports from a file like this: import {ThingA, ThingB, ThingC} from ‘lib/things’; However, I like the organization of having one module per file. I end up with imports like this: import ThingA from ‘lib/things/ThingA’; import ThingB from ‘lib/things/ThingB’; import ThingC from ‘lib/things/ThingC’; I would love to be able to … Read more

How can I alias a default import in JavaScript?

Using ES6 modules, I know I can alias a named import: import { foo as bar } from ‘my-module’; And I know I can import a default import: import defaultMember from ‘my-module’; I’d like to alias a default import and I had thought the following would work: import defaultMember as alias from ‘my-module’; But that … Read more