2 ms·
I tried it out myself. CommonJS (read everything in the wild) exports as default. That means you can't use the following syntax with (most) existing npm module
by styfle 9y ago
I tried it out myself. CommonJS (read everything in the wild) exports as default.
That means you can't use the following syntax with (most) existing npm modules:
import * as fs from 'fs';
import { map } from 'lodash';
https://github.com/nodejs/node/pull/14369#issuecomment-329034997 https://github.com/nodejs/node/pull/14369#issuecomment-32903...
- jdd 9y agoI know styfle is aware, but for others, you can unlock named exports of CJS modules with @std/esm: https://github.com/standard-things/esm https://github.com/standard-things/esm https://medium.com/web-on-the-edge/es-modules-in-node-today-32cff914e4b https://medium.com/web-on-the-edge/es-modules-in-node-today-...