process.release
process.release
属性返回 Object
,其中包含与当前版本相关的元数据,包括源 tarball 和 headers-only tarball 的网址。
process.release
包含以下属性:
name
<string> 始终为'node'
的值。sourceUrl
<string> 指向包含当前版本源代码的.tar.gz
文件的绝对网址。headersUrl
<string> 指向.tar.gz
文件的绝对网址,该文件仅包含当前版本的源头文件。 该文件比完整的源文件小得多,可用于编译 Node.js 原生插件。libUrl
<string> | <undefined> 指向与当前版本的体系结构和版本匹配的node.lib
文件的绝对网址。 此文件用于编译 Node.js 原生插件。 此属性仅存在于 Windows 构建的 Node.js 中,在所有其他平台上将缺失。lts
<string> | <undefined> 标识此版本的 LTS 标签的字符串标签。 此属性仅适用于 LTS 版本,对于所有其他版本类型(包括 Current 版本)为undefined
。 有效值包括 LTS 版本代码名称(包括不再受支持的代码名称)。- 以 14.15.0 开头的 14.x LTS 系列的
'Fermium'
。 - 以 16.13.0 开头的 16.x LTS 系列的
'Gallium'
。 'Hydrogen'
表示从 18.12.0 开始的 18.x LTS 行。有关其他 LTS 版本代码名称,请参阅 Node.js 日志变更存档
- 以 14.15.0 开头的 14.x LTS 系列的
{
name: 'node',
lts: 'Hydrogen',
sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz',
headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz',
libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib'
}
在源代码树的非发布版本的自定义构建中,可能只存在 name
属性。
不应依赖附加属性的存在。
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
contains the following properties:
name
<string> A value that will always be'node'
.sourceUrl
<string> an absolute URL pointing to a.tar.gz
file containing the source code of the current release.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> an absolute URL pointing to anode.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> a string label identifying the LTS label for this release. This property only exists for LTS releases and isundefined
for all other release types, including Current releases. Valid values include the LTS Release code names (including those that are no longer supported).'Fermium'
for the 14.x LTS line beginning with 14.15.0.'Gallium'
for the 16.x LTS line beginning with 16.13.0.'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.org/download/release/v18.12.0/node-v18.12.0.tar.gz',
headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz',
libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib'
}
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.