Skip to content

Commit

Permalink
doc: add importing util to example of `process.report.getReport'
Browse files Browse the repository at this point in the history
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: #47298
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
  • Loading branch information
deokjinkim authored and RafaelGSS committed Apr 8, 2023
1 parent 034082f commit 2192b5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2361,7 +2361,7 @@ console.log(memoryUsage.rss());
```
```cjs
const { rss } = require('node:process');
const { memoryUsage } = require('node:process');

console.log(memoryUsage.rss());
// 35655680
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 2192b5b

Please sign in to comment.