Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e3dd4d5

Browse filesBrowse files
vsemozhetbyttargos
authored andcommitted
doc: fix nits regarding stream utilities
* Unify headings. * Conform method mentions with the style guide. * Fix links. PR-URL: #28385 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3d693c5 commit e3dd4d5
Copy full SHA for e3dd4d5

File tree

Expand file treeCollapse file tree

1 file changed

+11
-10
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-10
lines changed
Open diff view settings
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+11-10Lines changed: 11 additions & 10 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ There are four fundamental stream types within Node.js:
4646
* [`Transform`][] - `Duplex` streams that can modify or transform the data as it
4747
is written and read (for example, [`zlib.createDeflate()`][]).
4848

49-
Additionally, this module includes the utility functions [pipeline][],
50-
[finished][] and [Readable.from][].
49+
Additionally, this module includes the utility functions
50+
[`stream.pipeline()`][], [`stream.finished()`][] and
51+
[`stream.Readable.from()`][].
5152

5253
### Object Mode
5354

@@ -1496,7 +1497,7 @@ async function run() {
14961497
run().catch(console.error);
14971498
```
14981499

1499-
### Readable.from(iterable, [options])
1500+
### stream.Readable.from(iterable, [options])
15001501

15011502
* `iterable` {Iterable} Object implementing the `Symbol.asyncIterator` or
15021503
`Symbol.iterator` iterable protocol.
@@ -2458,7 +2459,7 @@ and async iterators are provided below.
24582459
#### Creating Readable Streams with Async Generators
24592460

24602461
We can construct a Node.js Readable Stream from an asynchronous generator
2461-
using the `Readable.from` utility method:
2462+
using the `Readable.from()` utility method:
24622463

24632464
```js
24642465
const { Readable } = require('stream');
@@ -2499,10 +2500,10 @@ const writeable = fs.createWriteStream('./file');
24992500
```
25002501

25012502
In the above, errors on the write stream would be caught and thrown by the two
2502-
`once` listeners, since `once` will also handle `'error'` events.
2503+
`once()` listeners, since `once()` will also handle `'error'` events.
25032504

2504-
Alternatively the readable stream could be wrapped with `Readable.from` and
2505-
then piped via `.pipe`:
2505+
Alternatively the readable stream could be wrapped with `Readable.from()` and
2506+
then piped via `.pipe()`:
25062507

25072508
```js
25082509
const { once } = require('events');
@@ -2642,8 +2643,11 @@ contain multi-byte characters.
26422643
[`process.stdin`]: process.html#process_process_stdin
26432644
[`process.stdout`]: process.html#process_process_stdout
26442645
[`readable.push('')`]: #stream_readable_push
2646+
[`stream.Readable.from()`]: #stream_stream_readable_from_iterable_options
26452647
[`stream.cork()`]: #stream_writable_cork
2648+
[`stream.finished()`]: #stream_stream_finished_stream_options_callback
26462649
[`stream.pipe()`]: #stream_readable_pipe_destination_options
2650+
[`stream.pipeline()`]: #stream_stream_pipeline_streams_callback
26472651
[`stream.uncork()`]: #stream_writable_uncork
26482652
[`stream.unpipe()`]: #stream_readable_unpipe_destination
26492653
[`stream.wrap()`]: #stream_readable_wrap_stream
@@ -2655,18 +2659,15 @@ contain multi-byte characters.
26552659
[Compatibility]: #stream_compatibility_with_older_node_js_versions
26562660
[HTTP requests, on the client]: http.html#http_class_http_clientrequest
26572661
[HTTP responses, on the server]: http.html#http_class_http_serverresponse
2658-
[Readable.from]: #readable.from
26592662
[TCP sockets]: net.html#net_class_net_socket
26602663
[child process stdin]: child_process.html#child_process_subprocess_stdin
26612664
[child process stdout and stderr]: child_process.html#child_process_subprocess_stdout
26622665
[crypto]: crypto.html
2663-
[finished]: #stream_stream_finished_stream_options_callback
26642666
[fs read streams]: fs.html#fs_class_fs_readstream
26652667
[fs write streams]: fs.html#fs_class_fs_writestream
26662668
[http-incoming-message]: http.html#http_class_http_incomingmessage
26672669
[hwm-gotcha]: #stream_highwatermark_discrepancy_after_calling_readable_setencoding
26682670
[object-mode]: #stream_object_mode
2669-
[pipeline]: #stream_stream_pipeline_streams_callback
26702671
[readable-_destroy]: #stream_readable_destroy_err_callback
26712672
[readable-destroy]: #stream_readable_destroy_error
26722673
[stream-_final]: #stream_writable_final_callback

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.