doc: clarify execution timing and common use cases of --require flag#62041
Open
kishanngowda wants to merge 1 commit intonodejs:mainfrom
Open
doc: clarify execution timing and common use cases of --require flag#62041kishanngowda wants to merge 1 commit intonodejs:mainfrom
kishanngowda wants to merge 1 commit intonodejs:mainfrom
Conversation
aduh95
reviewed
Mar 3, 2026
| set up instrumentation, or apply polyfills before any application | ||
| code runs. | ||
|
|
||
| Modules preloaded with `--require` will run before modules preloaded with `--import`. |
Contributor
There was a problem hiding this comment.
It's true that it's both before the entry point and before --import, but it might be worth giving the actual timeline
Suggested change
| Modules preloaded with `--require` will run before modules preloaded with `--import`. | |
| Modules preloaded with `--require` will run before modules preloaded with `--import`, which will run before the program entry point is executed. |
aduh95
reviewed
Mar 3, 2026
Comment on lines
+2457
to
+2458
| Preload the specified module at startup, before the main entry point | ||
| of the application is executed. |
Contributor
There was a problem hiding this comment.
Given the other suggestion, we should remove it here to avoid duplication
Suggested change
| Preload the specified module at startup, before the main entry point | |
| of the application is executed. | |
| Preload the specified module at startup. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improves clarity of the
--requireCLI flag documentation.Adds a short explanation clarifying that the module is executed
before the main application entry point, and provides common
real-world use cases such as configuration setup, instrumentation,
or polyfills.
This change improves readability without modifying behavior.