process.release


process.release 属性返回 Object,其中包含与当前版本相关的元数据,包括源 tarball 和 headers-only tarball 的网址。

¥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 包含以下属性:

¥process.release contains the following properties:

  • name <string> 始终为 'node' 的值。

    ¥name <string> A value that will always be 'node'.

  • sourceUrl <string> 指向包含当前版本源代码的 .tar.gz 文件的绝对 URL。

    ¥sourceUrl <string> an absolute URL pointing to a .tar.gz file containing the source code of the current release.

  • headersUrl <string> 指向仅包含当前版本的源头文件的 .tar.gz 文件的绝对 URL。该文件比完整的源文件小得多,可用于编译 Node.js 原生插件。

    ¥headersUrl<string> an absolute URL pointing to a .tar.gz file containing only the source header files for the current release. This file is significantly smaller than the full source file and can be used for compiling Node.js native add-ons.

  • libUrl <string> | <undefined> 指向与当前版本的体系结构和版本匹配的 node.lib 文件的绝对 URL。此文件用于编译 Node.js 原生插件。此属性仅存在于 Node.js 的 Windows 构建中,在所有其他平台上将不存在。

    ¥libUrl <string> | <undefined> an absolute URL pointing to a node.lib file matching the architecture and version of the current release. This file is used for compiling Node.js native add-ons. This property is only present on Windows builds of Node.js and will be missing on all other platforms.

  • lts <string> | <undefined> 标识此版本的 LTS 标签的字符串标签。此属性仅适用于 LTS 版本,对于所有其他版本类型(包括当前版本)为 undefined。有效值包括 LTS 版本代码名称(包括不再受支持的代码名称)。

    ¥lts <string> | <undefined> a string label identifying the LTS label for this release. This property only exists for LTS releases and is undefined for all other release types, including Current releases. Valid values include the LTS Release code names (including those that are no longer supported).

    • 以 14.15.0 开头的 14.x LTS 系列的 'Fermium'

      ¥'Fermium' for the 14.x LTS line beginning with 14.15.0.

    • 以 16.13.0 开头的 16.x LTS 系列的 'Gallium'

      ¥'Gallium' for the 16.x LTS line beginning with 16.13.0.

    • 'Hydrogen' 用于从 18.12.0 开始的 18.x LTS 行。对于其他 LTS 版本代号,请参见 Node.js 变更日志存档

      ¥'Hydrogen' for the 18.x LTS line beginning with 18.12.0. For other LTS Release code names, see Node.js Changelog Archive

{
  name: 'node',
  lts: 'Hydrogen',
  sourceUrl: 'https://nodejs.cn/download/release/v18.12.0/node-v18.12.0.tar.gz',
  headersUrl: 'https://nodejs.cn/download/release/v18.12.0/node-v18.12.0-headers.tar.gz',
  libUrl: 'https://nodejs.cn/download/release/v18.12.0/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.