Hacker News new | ask | show | jobs
by tehbeard 1689 days ago
Well since you asked so "fuckin" nicely /s

    if( condition ){
      import('../../../hugeFuckingLibraryThatTakesSeveralSecondsToLoadUponColdStart').then( x => {
          //do something with x
      })
    }
> ...nerd bullshit...

I hate to break it to you darling, but programming is nerd bullshit.

edit: alternate that might too much "nerd bullshit", but uses async/await if the surrounding code is an async function:

     async function doSomeStuff()
    {
        if( condition ){
          const x = await import('../../../hugeFuckingLibraryThatTakesSeveralSecondsToLoadUponColdStart');
          //do something with x
        }
    }
1 comments

no bro, programming is programming and nerd bullshit is nerd bullshit. the arguments I see in favor of ESM over CJS fall into the latter category, at least on the node side of things.