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
Next Next commit
stream: fix lint and add started adding docs
  • Loading branch information
rluvaton committed Oct 26, 2022
commit fed2ac3613c3a65361014bdc23c7ed604941e2f0
19 changes: 19 additions & 0 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,25 @@ option. In the code example above, data will be in a single chunk if the file
has less then 64 KiB of data because no `highWaterMark` option is provided to
[`fs.createReadStream()`][].

##### `readable.compose(stream[, options])`

<!-- YAML
added:
-->

Comment thread
rluvaton marked this conversation as resolved.
> Stability: 1 - Experimental

* `stream` {Stream|Iterable|AsyncIterable|Function}
* `options` {Object}
* `signal` {AbortSignal} allows destroying the stream if the signal is
aborted.
* Returns: {Duplex} a stream composed with the stream `stream`.



See [`stream.compose`][] for more information.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an example please?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 👍🏻



##### `readable.iterator([options])`

<!-- YAML
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-stream-compose-operator.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ const assert = require('assert');
assert.throws(
() => Readable.from(['a']).compose(Readable.from(['b'])),
{ code: 'ERR_INVALID_ARG_VALUE' }
)
);
}

{
assert.throws(
() => Readable.from(['a']).compose(),
{ code: 'ERR_INVALID_ARG_TYPE' }
)
);
}
6 changes: 3 additions & 3 deletions test/parallel/test-stream-compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,21 +361,21 @@ const assert = require('assert');
assert.throws(
Comment thread
benjamingr marked this conversation as resolved.
() => compose(),
{ code: 'ERR_MISSING_ARGS' }
)
);
}

{
assert.throws(
() => compose(new Writable(), new PassThrough()),
{ code: 'ERR_INVALID_ARG_VALUE' }
)
);
}

{
assert.throws(
() => compose(new PassThrough(), new Readable({ read() {} }), new PassThrough()),
{ code: 'ERR_INVALID_ARG_VALUE' }
)
);
}

{
Expand Down