Skip to content

Instantly share code, notes, and snippets.

View h4dying's full-sized avatar
🎯
Focusing

Ahmed Elhady h4dying

🎯
Focusing
View GitHub Profile
@h4dying
h4dying / modules.md
Created August 10, 2022 14:34
What *REALLY* happens when we require() a module in Nodejs?

What happens when we require() a module?

There are 5 steps in this process:

  • Resolving & Loading.
  • Wrapping.
  • Execution.
  • Returning Exports.
  • Caching.