skip to content

Module Caching

0 questions

Modules execute once and are memoized in require.cache by resolved filename, which is what makes a module-level object a de facto singleton. Interviewers ask because it explains both shared state between importers and why tests leak state unless the cache is cleared between them.

questions

no questions here yet

this part of the tree is still being written

>
0 questions in this topic or below it