Skip to content

Commit ddeaa0a

Browse files
committed
doc: added additional details about --input-type
1 parent a628dda commit ddeaa0a

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

doc/api/cli.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,12 +1021,13 @@ Modules preloaded with `--require` will run before modules preloaded with `--imp
10211021
added: v12.0.0
10221022
-->
10231023

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

1027-
Valid values are `"commonjs"` and `"module"`. The default is `"commonjs"`.
1028-
1029-
The REPL does not support this option.
1028+
The REPL does not support this option. Usage of `--input-type=module` with
1029+
[`--print`][] will throw an error, as `--print` does not support ES module
1030+
syntax.
10301031

10311032
### `--insecure-http-parser`
10321033

@@ -2810,6 +2811,7 @@ done
28102811
[`--import`]: #--importmodule
28112812
[`--openssl-config`]: #--openssl-configfile
28122813
[`--preserve-symlinks`]: #--preserve-symlinks
2814+
[`--print`]: #-p---print-script
28132815
[`--redirect-warnings`]: #--redirect-warningsfile
28142816
[`--require`]: #-r---require-module
28152817
[`Atomics.wait()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait

0 commit comments

Comments
 (0)