From 5a2e2fc32e7e881fb4dbb14f90104a0f42cc79d0 Mon Sep 17 00:00:00 2001 From: Taeuk Ha Date: Wed, 5 Aug 2026 21:48:22 +0900 Subject: [PATCH] doc: add missing ESM examples to DEP0202 and DEP0207 DEP0202 and DEP0207 each have two consecutive cjs code blocks with no corresponding mjs block, breaking the cjs/mjs pairing convention used elsewhere in this file. Signed-off-by: Taeuk Ha --- doc/api/deprecations.md | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 0868f0fae4c1..799462bf7761 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -4541,6 +4541,17 @@ const server = http2.createSecureServer({ }); ``` +```mjs +import { createSecureServer } from 'node:http2'; + +// Deprecated +const server = createSecureServer({ + allowHTTP1: true, + Http1IncomingMessage: MyIncomingMessage, + Http1ServerResponse: MyServerResponse, +}); +``` + ```cjs // Use this instead const server = http2.createSecureServer({ @@ -4552,6 +4563,19 @@ const server = http2.createSecureServer({ }); ``` +```mjs +import { createSecureServer } from 'node:http2'; + +// Use this instead +const server = createSecureServer({ + allowHTTP1: true, + http1Options: { + IncomingMessage: MyIncomingMessage, + ServerResponse: MyServerResponse, + }, +}); +``` + ### DEP0203: Passing `CryptoKey` to `node:crypto` APIs