Closed jgaehring closed 2 years ago
Worth noting that CommonJS cannot load ES Modules with require()
(they have to use the asynchronous import()
instead), even though ES Modules can load all CommonJS modules. So we'll be losing a little bit of that flexibility, but I still don't think that's a deal-breaker.
More details from the Node docs: https://nodejs.org/api/esm.html#esm_interoperability_with_commonjs
Since this library never saw much use in Node production servers, I think it's safe to require Node v13.2.0 or higher so we can start using
import
/export
instead ofrequire()
. I'll open a separate issue related to specifying Node requirements. Note that we'll also need to enable this in ourpackage.json
, per https://nodejs.org/api/esm.html#esm_enabling.