Skip to content

Commit 11bf51a

Browse files
GeoffreyBoothkaran-lrn
authored andcommitted
doc: deprecate module.register() (DEP0205)
PR-URL: nodejs#62395 Reviewed-By: Jacob Smith <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 8bf2664 commit 11bf51a

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

doc/api/deprecations.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4523,7 +4523,21 @@ 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: Piping to emitters without `prependListener`
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+
4540+
### DEP0206: Piping to emitters without `prependListener`
45274541
45284542
<!-- YAML
45294543
changes:
@@ -4643,6 +4657,8 @@ the `_events` object will be removed in a future version.
46434657
[`message.trailersDistinct`]: http.md#messagetrailersdistinct
46444658
[`message.trailers`]: http.md#messagetrailers
46454659
[`module.createRequire()`]: module.md#modulecreaterequirefilename
4660+
[`module.register()`]: module.md#moduleregisterspecifier-parenturl-options
4661+
[`module.registerHooks()`]: module.md#moduleregisterhooksoptions
46464662
[`os.networkInterfaces()`]: os.md#osnetworkinterfaces
46474663
[`os.tmpdir()`]: os.md#ostmpdir
46484664
[`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)