I think it would have been more prudent if Node had chosen to stay closer to Babel compatibility in terms of how it handled ESM + Require. I know there were reasons to break things... but it could have been smoother.
You could achieve the same thing with a bunch of `import()` calls, but I'm not sure why you'd want to when you can just use the `import` keyword instead.
I have a ton of projects and a huge amount of utilities and such, that all use CJS.
You cannot just use 'import' if you also use CJS. To use 'import', it must be an ESM module and the you cannot use require() to access CJS utilities.
In CJS code, one can use import() to bring in ESM modules but, import() is asynchronous. The problem is that I have a lot of code that is not asynchronous. To add an asynchronous function requires substantial rewriting that I am rarely willing to do.
If, in addition to the asynchronous import(), there was a synchronous importSync(), I could use ESM modules any time I want. That would allow me to...
1) Use and support new utilities that are ESM.
2) Write new utilities that are ESM. Presently, I always target CJS because that's what I have to use.
I have read that there is a new version of NodeJS that supports using require() for ESM modules. That will be a huge, huge, huge improvement although I would prefer importSync() so that it was clear when I was using an ESM module. Even so, I will take it.
Why? Because there is no importSync(). If that existed, it would be easy to interoperate.