Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2022-04-20 11:23:41 +0300
committerMichaƫl Zasso <targos@protonmail.com>2022-04-28 07:56:14 +0300
commit3d65a3b13e61f136dc09027aa12473c2b3003725 (patch)
tree012259a22a22fec5325afd386bbae62e3293a09f /src
parent46c880b99b4a74c3a7c99fdd824bf9ce22333987 (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 'src')
-rw-r--r--src/crypto/README.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto/README.md b/src/crypto/README.md
index 8ebc3003da3..0b961979d2a 100644
--- a/src/crypto/README.md
+++ b/src/crypto/README.md
@@ -312,12 +312,12 @@ crypto.randomFill(buf, (err, buf) => {
For the legacy Node.js crypto API, asynchronous single-call
operations use the traditional Node.js callback pattern, as
illustrated in the previous `randomFill()` example. In the
-Web Crypto API (accessible via `require('crypto').webcrypto`),
+Web Crypto API (accessible via `require('node:crypto').webcrypto`),
all asynchronous single-call operations are Promise-based.
```js
// Example Web Crypto API asynchronous single-call operation
-const { subtle } = require('crypto').webcrypto;
+const { subtle } = require('node:crypto').webcrypto;
subtle.generateKeys({ name: 'HMAC', length: 256 }, true, ['sign'])
.then((key) => {