--input-type=type
这将 Node.js 配置为将字符串输入解释为 CommonJS 或 ES 模块。字符串输入是通过 --eval、--print 或 STDIN 输入的。
¥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.