You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • The second method is a smidge faster, but not too much - and it does use one more variable, so really it's personal opinion.

    Once the module has been loaded it's 'cached' and subsequent calls to require("module") will just do a lookup, so it's not like the whole thing is being loaded in each time.


Avatar for Gordon @Gordon started