nktnet1/import-sync

This seems to be coming to node natively soon

Closed this issue · 4 comments

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.

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.

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.

On that note I'll close this issue out, as it was mostly informative. Interesting project though 👍