From 2192b5b163dabd6c3e5b9a8f48784866a6f6d3fc 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 3a0b27b625e416..5bd6a0904d1032 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -2361,7 +2361,7 @@ console.log(memoryUsage.rss()); ``` ```cjs -const { rss } = require('node:process'); +const { memoryUsage } = require('node:process'); console.log(memoryUsage.rss()); // 35655680 @@ -2873,6 +2873,7 @@ present. ```mjs import { report } from 'node:process'; +import util from 'node:util'; const data = report.getReport(); console.log(data.header.nodejsVersion); @@ -2884,6 +2885,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);