diff options
author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2022-04-20 11:23:41 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2022-04-28 07:56:14 +0300 |
commit | 3d65a3b13e61f136dc09027aa12473c2b3003725 (patch) | |
tree | 012259a22a22fec5325afd386bbae62e3293a09f /doc/api/inspector.md | |
parent | 46c880b99b4a74c3a7c99fdd824bf9ce22333987 (diff) |
doc: add `node:` prefix for all core modules
Some core modules can be loaded with or without the `node:` prefix.
Using the prefix disambiguates which specifiers refer to core modules.
This commit updates the docs to use the prefix everywhere a core module
is referenced.
PR-URL: https://github.com/nodejs/node/pull/42752
Fixes: https://github.com/nodejs/node/issues/38343
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Diffstat (limited to 'doc/api/inspector.md')
-rw-r--r-- | doc/api/inspector.md | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/doc/api/inspector.md b/doc/api/inspector.md index fad9e0603fa..90bc90e2d12 100644 --- a/doc/api/inspector.md +++ b/doc/api/inspector.md @@ -6,12 +6,13 @@ <!-- source_link=lib/inspector.js --> -The `inspector` module provides an API for interacting with the V8 inspector. +The `node:inspector` module provides an API for interacting with the V8 +inspector. It can be accessed using: ```js -const inspector = require('inspector'); +const inspector = require('node:inspector'); ``` ## `inspector.close()` @@ -23,7 +24,7 @@ Deactivate the inspector. Blocks until there are no active connections. * {Object} An object to send messages to the remote inspector console. ```js -require('inspector').console.log('a message'); +require('node:inspector').console.log('a message'); ``` The inspector console does not have API parity with Node.js @@ -209,8 +210,8 @@ protocol. Here's an example showing how to use the [CPU Profiler][]: ```js -const inspector = require('inspector'); -const fs = require('fs'); +const inspector = require('node:inspector'); +const fs = require('node:fs'); const session = new inspector.Session(); session.connect(); @@ -234,8 +235,8 @@ session.post('Profiler.enable', () => { Here's an example showing how to use the [Heap Profiler][]: ```js -const inspector = require('inspector'); -const fs = require('fs'); +const inspector = require('node:inspector'); +const fs = require('node:fs'); const session = new inspector.Session(); const fd = fs.openSync('profile.heapsnapshot', 'w'); |