Skip to content
Merged
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
Next Next commit
doc: --require module supports ES modules
  • Loading branch information
JLHwung committed Mar 25, 2025
commit 02bf67b5a25b30bb7c48dafce1efa2fb93bf5c2e
11 changes: 9 additions & 2 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2188,15 +2188,22 @@ native stack and other runtime environment data.

<!-- YAML
added: v1.6.0
changes:
- version:
- v23.0.0
- v22.12.0
- v20.19.0
pr-url: https://github.com/nodejs/node/issues/52697
description: This option also supports ECMAScript module.
-->

Preload the specified module at startup.

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

Only CommonJS modules are supported.
Use [`--import`][] to preload an [ECMAScript module][].
Both CommonJS module and [ECMAScript module][] are supported.
Use [`--import`][] to preload only [ECMAScript module][].
Comment thread
JLHwung marked this conversation as resolved.
Outdated
Modules preloaded with `--require` will run before modules preloaded with `--import`.

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