Skip to content
Prev Previous commit
Next Next commit
doc: add history entries to --input-type section
PR-URL: #58175
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
aduh95 authored and marco-ippolito committed Jul 3, 2025
commit 5aaa592bdac9f0e3a62434d885d5d6ebe343c1e8
11 changes: 10 additions & 1 deletion doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1482,12 +1482,21 @@ forked processes, or clustered processes.

<!-- YAML
added: v12.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/56350
description: Add support for `-typescript` values.
- version:
- v22.7.0
- v20.19.0
pr-url: https://github.com/nodejs/node/pull/53619
description: ESM syntax detection is enabled by default.
-->

This configures Node.js to interpret `--eval` or `STDIN` input as CommonJS or
as an ES module. Valid values are `"commonjs"`, `"module"`, `"module-typescript"` and `"commonjs-typescript"`.
The `"-typescript"` values are not available with the flag `--no-experimental-strip-types`.
The default is `"commonjs"`.
The default is no value, or `"commonjs"` if `--no-experimental-detect-module` is passed.

If `--input-type` is not provided,
Node.js will try to detect the syntax with the following steps:
Expand Down