process.report是過程模塊中的Process類的內置應用程序編程接口,用於提供生成當前過程的診斷報告的方法。
用法:
const process.report
返回值:此屬性返回用於生成當前過程的診斷報告的方法。
範例1:
index.js
// Node.js program to demonstrate the
// Process.report Property
// Importing process module
const process = require('process');
// Getting reports of the current process
const reports = process.report;
// Display the result
console.log(reports)
使用以下命令運行index.js文件:
node index.js
輸出:
{ writeReport:[Function:writeReport], getReport:[Function:getReport], directory:[Getter/Setter], filename:[Getter/Setter], compact:[Getter/Setter], signal:[Getter/Setter], reportOnFatalError:[Getter/Setter], reportOnSignal:[Getter/Setter], reportOnUncaughtException:[Getter/Setter] }
範例2:
index.js
// Node.js program to demonstrate the
// Process.report Property
// Importing process module
const process = require('process');
// If Report is present
if (process.report) {
// Printing Report Compact Status
console.log(process.report.compact)
} else {
console.log("Unable to print Report Compact Status")
}
使用以下命令運行index.js文件:
node index.js
輸出:
false
參考: https://nodejs.org/dist/latest-v16.x/docs/api/process.html#process_process_report
相關用法
- Node.js GM charcoal()用法及代碼示例
- Node.js GM blur()用法及代碼示例
- Node.js GM sharpen()用法及代碼示例
- Node.js GM drawLine()用法及代碼示例
注:本文由純淨天空篩選整理自RohitPrasad3大神的英文原創作品 Node.js process.report Property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。