Visitar URL original
stream: rename `Duplex.toWeb()` type option to `readableType` by Renegade334 · Pull Request #61632 · nodejs/node · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! stream: rename Duplex.toWeb() type option to readableType
  • Loading branch information
Renegade334 committed Feb 8, 2026
commit c16967ae5fc69e0f7cbb3efce052fd27fc4dfd7b
16 changes: 16 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4388,6 +4388,21 @@ import { opendir } from 'node:fs/promises';
}
```

### DEP0201: Passing `options.type` to `Duplex.toWeb()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/61632
description: Documentation-only deprecation.
-->

Type: Documentation-only

Passing the `type` option to [`Duplex.toWeb()`][] is deprecated. To specify the
type of the readable half of the constructed readable-writable pair, use the
`readableType` option instead.

[DEP0142]: #dep0142-repl_builtinlibs
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
Expand All @@ -4406,6 +4421,7 @@ import { opendir } from 'node:fs/promises';
[`Buffer.isBuffer()`]: buffer.md#static-method-bufferisbufferobj
[`Cipheriv`]: crypto.md#class-cipheriv
[`Decipheriv`]: crypto.md#class-decipheriv
[`Duplex.toWeb()`]: stream.md#streamduplextowebstreamduplex-options
[`Error.isError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError
[`REPLServer.clearBufferedCommand()`]: repl.md#replserverclearbufferedcommand
[`ReadStream.open()`]: fs.md#class-fsreadstream
Expand Down
4 changes: 3 additions & 1 deletion doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -3401,7 +3401,8 @@ added: v17.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/61632
description: The 'type' option is renamed to 'readableType'.
description: Added the 'readableType' option to specify the ReadableStream
type. The 'type' option is deprecated.
- version: v25.4.0
pr-url: https://github.com/nodejs/node/pull/58664
description: Added the 'type' option to specify the ReadableStream type.
Expand All @@ -3416,6 +3417,7 @@ changes:
* `options` {Object}
* `readableType` {string} Specifies the type of the `ReadableStream` half of
the created readable-writable pair. Must be `'bytes'` or undefined.
Comment thread
jasnell marked this conversation as resolved.
Resolved
(`options.type` is a deprecated alias for this option.)
* Returns: {Object}
* `readable` {ReadableStream}
* `writable` {WritableStream}
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/webstreams/adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ function newReadableWritablePairFromDuplex(duplex, options = kEmptyObject) {

const readableOptions = {
__proto__: null,
// 'options.type' is a legacy alias for 'options.readableType'
// DEP0201: 'options.type' is a deprecated alias for 'options.readableType'
type: options.readableType ?? options.type,
};

Expand Down
Loading