module.constants.compileCacheStatus
新增于: v22.8.0
稳定性: 1.1 - 积极开发
\Stability: 1.1 - Active Development
以下常量作为 module.enableCompileCache() 返回的对象中的 status 字段返回,以指示尝试启用 模块编译缓存 的结果。
\The following constants are returned as the status field in the object returned by
module.enableCompileCache() to indicate the result of the attempt to enable the
module compile cache.
| 常量 | 描述 |
|---|---|
ENABLED |
Node.js 已成功启用编译缓存。用于存储编译缓存的目录将在返回对象中的 directory 字段中返回。
|
ALREADY_ENABLED |
编译缓存之前已经启用,要么是通过之前对
module.enableCompileCache() 的调用,要么是通过 NODE_COMPILE_CACHE=dir 环境变量。用于存储编译缓存的目录将在返回对象中的 directory 字段中返回。
|
FAILED |
Node.js 无法启用编译缓存。这可能是由于缺少使用指定目录的权限或各种文件系统错误造成的。失败的详细信息将在返回对象的 message 字段中返回。
|
DISABLED |
Node.js 无法启用编译缓存,因为环境变量
NODE_DISABLE_COMPILE_CACHE=1 已设置。
|