From 3e74a74da3b5ee153b09a06493b478fdd95b8bc6 Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Sat, 1 Apr 2023 00:37:56 +0900 Subject: [PATCH] doc: add importing util to example of `process.report.getReport' util.inspect() is used, but `util` is not imported. So added importing util to example of `process.report.getReport`. Plus, fix wrong importing in example of `process.memoryUsage.rss()`. PR-URL: https://github.com/nodejs/node/pull/47298 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Harshitha K P --- doc/api/process.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/process.md b/doc/api/process.md index 3b1197b810eb92..8bedad22ed23bc 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -2365,7 +2365,7 @@ console.log(memoryUsage.rss()); ``` ```cjs -const { rss } = require('node:process'); +const { memoryUsage } = require('node:process'); console.log(memoryUsage.rss()); // 35655680 @@ -2877,6 +2877,7 @@ present. ```mjs import { report } from 'node:process'; +import util from 'node:util'; const data = report.getReport(); console.log(data.header.nodejsVersion); @@ -2888,6 +2889,7 @@ fs.writeFileSync('my-report.log', util.inspect(data), 'utf8'); ```cjs const { report } = require('node:process'); +const util = require('node:util'); const data = report.getReport(); console.log(data.header.nodejsVersion);