process.release
process.release
属性返回 Object
,其中包含与当前版本相关的元数据,包括源 tarball 和 headers-only tarball 的网址。
process.release
包含以下属性:
-
name
<string> -
sourceUrl
<string> 指向包含当前版本源代码的.tar.gz
文件的绝对网址。 -
headersUrl
<string> 指向.tar.gz
文件的绝对网址,该文件仅包含当前版本的源头文件。 该文件比完整的源文件小得多,可用于编译 Node.js 原生插件。 -
libUrl
<string> 指向与当前版本的体系结构和版本匹配的node.lib
文件的绝对网址。 此文件用于编译 Node.js 原生插件。 此属性仅存在于 Windows 构建的 Node.js 中,在所有其他平台上将缺失。 -
lts
<string> 标识此版本的 LTS 标签的字符串标签。 此属性仅适用于 LTS 版本,对于所有其他版本类型(包括 Current 版本)为undefined
。'Dubnium'
表示以 10.13.0 开头的 10.x LTS 行。
{
name: 'node',
lts: 'Erbium',
sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz',
headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz',
libUrl: 'https://nodejs.org/download/release/v12.18.1/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'
for Node.js. For legacy io.js releases, this will be'io.js'
.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> 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> 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 Codenames (including those that are no longer supported). A non-exhaustive example of these codenames includes:'Dubnium'
for the 10.x LTS line beginning with 10.13.0.'Erbium'
for the 12.x LTS line beginning with 12.13.0. For other LTS Release Codenames, see Node.js Changelog Archive
{
name: 'node',
lts: 'Erbium',
sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz',
headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz',
libUrl: 'https://nodejs.org/download/release/v12.18.1/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.