3 ms·
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
by jitl 5y 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.
- throwaway2077 5y agothat'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