From 39e3ef773981edc72ef01ac488bf1ada23b97394 Mon Sep 17 00:00:00 2001 From: Mike MacCana Date: Fri, 28 Sep 2018 12:03:57 +0100 Subject: [PATCH] Replace vague 'may not' with definitive 'will not' This vagueness of 'may' has caused a great deal of confusion. See https://stackoverflow.com/questions/8887318 PR-URL: https://github.com/nodejs/node/pull/23143 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca Reviewed-By: John-David Dalton Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Trivikram Kamat --- doc/api/modules.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/api/modules.md b/doc/api/modules.md index 9919a675169e8b..add37abf2adc14 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -200,10 +200,11 @@ 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')` may 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. +Provided `require.cache` is not modified, 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. To have a module execute code multiple times, export a function, and call that function.