Skip to content
Merged
Changes from all commits
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
11 changes: 10 additions & 1 deletion doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1457,12 +1457,21 @@

<!-- YAML
added: v12.0.0
changes:
- version: v23.6.0
pr-url: https://github.com/nodejs/node/pull/56350

Check warning on line 1462 in doc/api/cli.md

View workflow job for this annotation

GitHub Actions / lint-pr-url

pr-url doesn't match the URL of the current PR.
description: Add support for `-typescript` values.
- version:
- v22.7.0
- v20.19.0
pr-url: https://github.com/nodejs/node/pull/53619

Check warning on line 1467 in doc/api/cli.md

View workflow job for this annotation

GitHub Actions / lint-pr-url

pr-url doesn't match the URL of the current PR.
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
Loading