Skip to content

Commit 0aba975

Browse files
committed
doc: clarify execution timing and common use cases of --require flag
1 parent 27261b9 commit 0aba975

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/api/cli.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2454,11 +2454,16 @@ changes:
24542454
description: This option also supports ECMAScript module.
24552455
-->
24562456

2457-
Preload the specified module at startup.
2457+
Preload the specified module at startup, before the main entry point
2458+
of the application is executed.
24582459

24592460
Follows `require()`'s module resolution
24602461
rules. `module` may be either a path to a file, or a node module name.
24612462

2463+
This option is commonly used to initialize global configuration,
2464+
set up instrumentation, or apply polyfills before any application
2465+
code runs.
2466+
24622467
Modules preloaded with `--require` will run before modules preloaded with `--import`.
24632468

24642469
Modules are preloaded into the main thread as well as any worker threads,

0 commit comments

Comments
 (0)