diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 93f0bd3c1a169f..3175d391032ae4 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -42,7 +42,7 @@ calling `require('node:crypto')` will result in an error being thrown. When using CommonJS, the error thrown can be caught using try/catch: - + ```cjs let crypto; @@ -53,6 +53,8 @@ try { } ``` + + When using the lexical ESM `import` keyword, the error can only be caught if a handler for `process.on('uncaughtException')` is registered _before_ any attempt to load the module is made (using, for instance, diff --git a/doc/api/errors.md b/doc/api/errors.md index 6b32c3fafae898..38a29a1aae5000 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -2940,9 +2940,7 @@ signal (such as [`subprocess.kill()`][]). [self-reference a package using its name][] and [define a custom subpath][] in the [`"exports"`][] field of the [`package.json`][] file. - - -```js +```mjs import './'; // unsupported import './index.js'; // supported import 'package-name'; // supported diff --git a/doc/api/http.md b/doc/api/http.md index 11b01b6e9ee767..e0b2c55a56a3d0 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -16,14 +16,12 @@ user is able to stream data. HTTP message headers are represented by an object like this: - - -```js -{ 'content-length': '123', - 'content-type': 'text/plain', - 'connection': 'keep-alive', - 'host': 'example.com', - 'accept': '*/*' } +```json +{ "content-length": "123", + "content-type": "text/plain", + "connection": "keep-alive", + "host": "example.com", + "accept": "*/*" } ``` Keys are lowercased. Values are not modified. diff --git a/doc/api/https.md b/doc/api/https.md index 20f427d3b7dfd9..8ae80d28b61654 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -17,8 +17,6 @@ calling `require('node:https')` will result in an error being thrown. When using CommonJS, the error thrown can be caught using try/catch: - - ```cjs let https; try { diff --git a/doc/api/querystring.md b/doc/api/querystring.md index 752d4b9d584242..f7f45d57d927ce 100644 --- a/doc/api/querystring.md +++ b/doc/api/querystring.md @@ -87,12 +87,10 @@ collection of key and value pairs. For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - - -```js +```json { - foo: 'bar', - abc: ['xyz', '123'] + "foo": "bar", + "abc": ["xyz", "123"] } ``` diff --git a/doc/api/tls.md b/doc/api/tls.md index 37f26189e5e62e..79544012484589 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -22,8 +22,6 @@ calling `require('node:tls')` will result in an error being thrown. When using CommonJS, the error thrown can be caught using try/catch: - - ```cjs let tls; try { diff --git a/doc/api/util.md b/doc/api/util.md index bf154500f64e3e..4e7cb2e6dd1629 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -2513,9 +2513,7 @@ added: v10.0.0 Returns `true` if the value is an instance of a [Module Namespace Object][]. - - -```js +```mjs import * as ns from './a.js'; util.types.isModuleNamespaceObject(ns); // Returns true