--input-type=type


这会配置 Node.js 将字符串输入解释为 CommonJS 或 ES 模块。字符串输入可以通过 --eval--printSTDIN 提供。

【This configures Node.js to interpret string input as CommonJS or as an ES module. String input is input via --eval, --print, or STDIN.】

有效值为 "commonjs""module"。默认值为 "commonjs"

【Valid values are "commonjs" and "module". The default is "commonjs".】

REPL 不支持此选项。

【The REPL does not support this option.】