Skip to content

Commit

Permalink
doc: add additional details about --input-type
Browse files Browse the repository at this point in the history
PR-URL: #50796
Fixes: #50781
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
  • Loading branch information
shubham9411 authored and targos committed Dec 4, 2023
1 parent 709ac47 commit b281e98
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1072,12 +1072,13 @@ Modules preloaded with `--require` will run before modules preloaded with `--imp
added: v12.0.0
-->

This configures Node.js to interpret string input as CommonJS or as an ES
module. String input is input via `--eval`, `--print`, or `STDIN`.
This configures Node.js to interpret `--eval` or `STDIN` input as CommonJS or
as an ES module. Valid values are `"commonjs"` or `"module"`. The default is
`"commonjs"` unless [`--experimental-default-type=module`][] is used.

Valid values are `"commonjs"` and `"module"`. The default is `"commonjs"`.

The REPL does not support this option.
The REPL does not support this option. Usage of `--input-type=module` with
[`--print`][] will throw an error, as `--print` does not support ES module
syntax.

### `--insecure-http-parser`

Expand Down Expand Up @@ -2864,6 +2865,7 @@ done
[`--import`]: #--importmodule
[`--openssl-config`]: #--openssl-configfile
[`--preserve-symlinks`]: #--preserve-symlinks
[`--print`]: #-p---print-script
[`--redirect-warnings`]: #--redirect-warningsfile
[`--require`]: #-r---require-module
[`Atomics.wait()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait
Expand Down

0 comments on commit b281e98

Please sign in to comment.