Hacker News new | ask | show | jobs
by jitl 1688 days ago
You can replace that require with `await import(‘giantLibrary’)` but now your function needs to be async, and so do all of its callers. This is needed because it’s unacceptable to block the UI thread synchronously importing code in the browser, but in CLI programs not being able to synchronously require is a bit annoying.
1 comments

that's a shame, I hoped there was going to be a way to do that and it was simply not implemented in node at the time I was looking into it