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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Harshitha K P <[email protected]>
  • Loading branch information
deokjinkim authored and danielleadams committed Jul 6, 2023
1 parent d1c8229 commit 3e74a74
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 @@ -2365,7 +2365,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 @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 3e74a74

Please sign in to comment.