process.report.filename


报告写入的文件名。如果设置为空字符串,输出文件名将由时间戳、进程ID和序列号组成。默认值为空字符串。

【Filename where the report is written. If set to the empty string, the output filename will be comprised of a timestamp, PID, and sequence number. The default value is the empty string.】

如果 process.report.filename 的值被设置为 'stdout''stderr',报告将分别写入进程的标准输出或标准错误。

【If the value of process.report.filename is set to 'stdout' or 'stderr', the report is written to the stdout or stderr of the process respectively.】

import { report } from 'node:process';

console.log(`Report filename is ${report.filename}`);const { report } = require('node:process');

console.log(`Report filename is ${report.filename}`);