This seems to be coming to node natively soon
Closed this issue · 4 comments
nktnet1 commented
Yep - good news. Thanks for sharing @morganney!
import-sync will likely still be around to support older versions of Node, but this is a nice addition to NodeJS.
morganney commented
I don’t suppose you found a way to import a module using top level await? There doesn’t seem to be a way as the two module systems are fundamentally incompatible in this way. Sync vs Async.
nktnet1 commented
I haven't looked too deeply - asynchronous imports are outside the scope of import-sync :).
The primary goal of this library was to synchronously import ESM to CJS (or vice versa) in NodeJS.
morganney commented
On that note I'll close this issue out, as it was mostly informative. Interesting project though 👍