Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Mention modules will load once by default.
  • Loading branch information
mikemaccana authored Sep 28, 2018
commit cb473e7cf6be1219257d115e7f2027b57d100578
10 changes: 6 additions & 4 deletions doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,12 @@ Modules are cached after the first time they are loaded. This means
(among other things) that every call to `require('foo')` will get
exactly the same object returned, if it would resolve to the same file.

Multiple calls to `require('foo')` will not cause the module code to be
executed multiple times. This is an important feature. With it,
"partially done" objects can be returned, thus allowing transitive
dependencies to be loaded even when they would cause cycles.
By default (provided the `require.cache` is not modified) ,ultiple calls to
`require('foo')` will not cause the module code to be executed multiple times.

This is an important feature. With it, "partially done" objects can be returned,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line has trailing space and exceeds the limit of 80 characters producing linter issue.

thus allowing transitive dependencies to be loaded even when they would cause
cycles.

To have a module execute code multiple times, export a function, and call
that function.
Expand Down