process.release


process.release 属性返回一个 Object,其中包含与当前版本相关的元数据,包括源代码压缩包和仅包含头文件的压缩包的 URL。

🌐 The process.release property returns an Object containing metadata related to the current release, including URLs for the source tarball and headers-only tarball.

process.release 包含以下属性:

  • name <string> 一个始终为 'node' 的值。
  • sourceUrl <string> 一个指向包含当前版本源代码的 .tar.gz 文件的绝对 URL。
  • headersUrl<string> 是一个指向 .tar.gz 文件的绝对 URL,该文件仅包含当前版本的源头头文件。该文件比完整的源文件小得多,可用于编译 Node.js 原生插件。
  • libUrl <string> 一个指向与当前版本的架构和版本匹配的 node.lib 文件的绝对 URL。此文件用于编译 Node.js 原生插件。此属性仅存在于 Windows 版本的 Node.js,在其他所有平台上都不存在。
  • lts <string> 用于标识此版本的 长期支持 标签的字符串标签。此属性仅存在于 LTS 版本中,对于所有其他版本类型(包括 Current 版本),其值为 undefined。有效值包括 LTS 版本的代号(包括那些已不再受支持的代号)。
    • ‘Dubnium’ 适用于从 10.13.0 开始的 10.x LTS 系列。
    • 12.x LTS 系列从 12.13.0 开始的版本代号为 'Erbium'。有关其他 LTS 版本代号,请参见 Node.js 更新日志存档
{
  name: 'node',
  lts: 'Erbium',
  sourceUrl: 'https://nodejs.cn/download/release/v12.18.1/node-v12.18.1.tar.gz',
  headersUrl: 'https://nodejs.cn/download/release/v12.18.1/node-v12.18.1-headers.tar.gz',
  libUrl: 'https://nodejs.cn/download/release/v12.18.1/win-x64/node.lib'
} 

在非发布版本源码树的自定义构建中,可能只有 name 属性存在。其他附加属性不应被依赖为一定存在。

🌐 In custom builds from non-release versions of the source tree, only the name property may be present. The additional properties should not be relied upon to exist.