Skip to content

Commit e9b5214

Browse files
doc: deprecate module.register() (DEP0205)
PR-URL: #62395 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent f92c61f commit e9b5214

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

doc/api/deprecations.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4523,6 +4523,20 @@ Type: Runtime
45234523
Passing a non-extractable [`CryptoKey`][] to [`KeyObject.from()`][] is
45244524
deprecated and will throw an error in a future version.
45254525
4526+
### DEP0205: `module.register()`
4527+
4528+
<!-- YAML
4529+
changes:
4530+
- version: REPLACEME
4531+
pr-url: https://github.com/nodejs/node/pull/62395
4532+
description: Documentation-only deprecation.
4533+
-->
4534+
4535+
Type: Documentation-only
4536+
4537+
[`module.register()`][] is deprecated. Use [`module.registerHooks()`][]
4538+
instead.
4539+
45264540
[DEP0142]: #dep0142-repl_builtinlibs
45274541
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
45284542
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -4627,6 +4641,8 @@ deprecated and will throw an error in a future version.
46274641
[`message.trailersDistinct`]: http.md#messagetrailersdistinct
46284642
[`message.trailers`]: http.md#messagetrailers
46294643
[`module.createRequire()`]: module.md#modulecreaterequirefilename
4644+
[`module.register()`]: module.md#moduleregisterspecifier-parenturl-options
4645+
[`module.registerHooks()`]: module.md#moduleregisterhooksoptions
46304646
[`os.networkInterfaces()`]: os.md#osnetworkinterfaces
46314647
[`os.tmpdir()`]: os.md#ostmpdir
46324648
[`process.env`]: process.md#processenv

doc/api/module.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@ isBuiltin('wss'); // false
178178
added:
179179
- v20.6.0
180180
- v18.19.0
181+
deprecated: REPLACEME
181182
changes:
183+
- version: REPLACEME
184+
pr-url: https://github.com/nodejs/node/pull/62395
185+
description: Documentation-only deprecation (DEP0205). Use
186+
`module.registerHooks()` instead.
182187
- version:
183188
- v23.6.1
184189
- v22.13.1
@@ -193,7 +198,7 @@ changes:
193198
description: Add support for WHATWG URL instances.
194199
-->
195200
196-
> Stability: 1.1 - Active development
201+
> Stability: 0 - Deprecated: Use [`module.registerHooks()`][] instead.
197202
198203
* `specifier` {string|URL} Customization hooks to be registered; this should be
199204
the same string that would be passed to `import()`, except that if it is

test/doctool/test-doc-api-json.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,5 @@ for await (const dirent of await fs.opendir(new URL('../../out/doc/api/', import
159159
assert.partialDeepStrictEqual(allExpectedKeys, findAllKeys(json));
160160
}
161161

162-
assert.strictEqual(numberOfDeprecatedSections, 44); // Increase this number every time a new API is deprecated.
162+
assert.strictEqual(numberOfDeprecatedSections, 45); // Increase this number every time a new API is deprecated.
163163
assert.strictEqual(numberOfRemovedAPIs, 46); // Increase this number every time a section is marked as removed.

0 commit comments

Comments
 (0)