Open SamAxe opened 4 days ago
This is a proof of concept/work in progress of converting to ES6 modules, not ready for merging, but here for sharing and commenting and suggesting...
Node23.x adds new support for, require(esm), https://joyeecheung.github.io/blog/2024/03/18/require-esm-in-node-js/ and https://nodejs.org/en/blog/announcements/v22-release-announce#support-requireing-synchronous-esm-graphs, to the require word that supports importing es6 modules from commonJS files, which was previously not possible. Thus, I thought it might be possible to do an incremental conversion on a file by file basis to ES6 modules.
require(esm)
require
I'm using yarn build and yarn runtests to check the work. The runtests target does result in some pending operations. I've probably gone a bit past my JavaScript skills with this attempt...
yarn build
yarn runtests
This is a proof of concept/work in progress of converting to ES6 modules, not ready for merging, but here for sharing and commenting and suggesting...
Node23.x adds new support for,
require(esm)
, https://joyeecheung.github.io/blog/2024/03/18/require-esm-in-node-js/ and https://nodejs.org/en/blog/announcements/v22-release-announce#support-requireing-synchronous-esm-graphs, to therequire
word that supports importing es6 modules from commonJS files, which was previously not possible. Thus, I thought it might be possible to do an incremental conversion on a file by file basis to ES6 modules.I'm using
yarn build
andyarn runtests
to check the work. The runtests target does result in some pending operations. I've probably gone a bit past my JavaScript skills with this attempt...