From c3919234458b5fef1a8fb914ced0e80ae7bd8f60 Mon Sep 17 00:00:00 2001 From: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com> Date: Wed, 29 May 2024 20:46:42 -0400 Subject: [PATCH] doc: include ESM import for HTTP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/53165 Reviewed-By: Matteo Collina Reviewed-By: Paolo Insogna Reviewed-By: Marco Ippolito Reviewed-By: Vinícius Lourenço Claro Cardoso --- doc/api/http.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/http.md b/doc/api/http.md index 5e6ed88aa441d7..a41ec8838c8257 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -6,7 +6,8 @@ -To use the HTTP server and client one must `require('node:http')`. +This module, containing both a client and server, can be imported via +`require('node:http')` (CommonJS) or `import * as http from 'node:http'` (ES module). The HTTP interfaces in Node.js are designed to support many features of the protocol which have been traditionally difficult to use.