DEP0138:process.mainModule
类型:仅文档
¥Type: Documentation-only
process.mainModule
是 CommonJS 独有的特性,而 process
全局对象与非 CommonJS 环境共享。不支持在 ECMAScript 模块中使用它。
¥process.mainModule
is a CommonJS-only feature while process
global
object is shared with non-CommonJS environment. Its use within ECMAScript
modules is unsupported.
它已被弃用,取而代之的是 require.main
,因为它具有相同的目的并且仅在 CommonJS 环境中可用。
¥It is deprecated in favor of require.main
, because it serves the same
purpose and is only available on CommonJS environment.