Skip to content

Commit 5ea48a9

Browse files
Trotttargos
authored andcommitted
doc: fix minor text issues in stream.md
Implement several minor grammar, punctuation, and style fixes in stream.md. PR-URL: #24116 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
1 parent 8a3836e commit 5ea48a9

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

doc/api/stream.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ 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][] and
49+
Additionally, this module includes the utility functions [pipeline][] and
5050
[finished][].
5151

5252
### Object Mode
@@ -97,7 +97,7 @@ is to limit the buffering of data to acceptable levels such that sources and
9797
destinations of differing speeds will not overwhelm the available memory.
9898

9999
Because [`Duplex`][] and [`Transform`][] streams are both `Readable` and
100-
`Writable`, each maintain *two* separate internal buffers used for reading and
100+
`Writable`, each maintains *two* separate internal buffers used for reading and
101101
writing, allowing each side to operate independently of the other while
102102
maintaining an appropriate and efficient flow of data. For example,
103103
[`net.Socket`][] instances are [`Duplex`][] streams whose `Readable` side allows
@@ -388,7 +388,7 @@ changes:
388388
not operating in object mode, `chunk` must be a string, `Buffer` or
389389
`Uint8Array`. For object mode streams, `chunk` may be any JavaScript value
390390
other than `null`.
391-
* `encoding` {string} The encoding, if `chunk` is a string
391+
* `encoding` {string} The encoding if `chunk` is a string
392392
* `callback` {Function} Optional callback for when the stream is finished
393393
* Returns: {this}
394394

@@ -531,7 +531,7 @@ not draining may lead to a remotely exploitable vulnerability.
531531

532532
Writing data while the stream is not draining is particularly
533533
problematic for a [`Transform`][], because the `Transform` streams are paused
534-
by default until they are piped or an `'data'` or `'readable'` event handler
534+
by default until they are piped or a `'data'` or `'readable'` event handler
535535
is added.
536536

537537
If the data to be written can be generated or fetched on demand, it is
@@ -610,7 +610,7 @@ until a mechanism for either consuming or ignoring that data is provided. If
610610
the consuming mechanism is disabled or taken away, the `Readable` will *attempt*
611611
to stop generating the data.
612612

613-
For backwards compatibility reasons, removing [`'data'`][] event handlers will
613+
For backward compatibility reasons, removing [`'data'`][] event handlers will
614614
**not** automatically pause the stream. Also, if there are piped destinations,
615615
then calling [`stream.pause()`][stream-pause] will not guarantee that the
616616
stream will *remain* paused once those destinations drain and ask for more data.
@@ -1351,7 +1351,7 @@ Especially useful in error handling scenarios where a stream is destroyed
13511351
prematurely (like an aborted HTTP request), and will not emit `'end'`
13521352
or `'finish'`.
13531353

1354-
The `finished` API is promisify'able as well;
1354+
The `finished` API is promisify-able as well;
13551355

13561356
```js
13571357
const finished = util.promisify(stream.finished);
@@ -1403,7 +1403,7 @@ pipeline(
14031403
);
14041404
```
14051405

1406-
The `pipeline` API is promisify'able as well:
1406+
The `pipeline` API is promisify-able as well:
14071407

14081408
```js
14091409
const pipeline = util.promisify(stream.pipeline);
@@ -1892,7 +1892,7 @@ changes:
18921892
any JavaScript value.
18931893
* `encoding` {string} Encoding of string chunks. Must be a valid
18941894
`Buffer` encoding, such as `'utf8'` or `'ascii'`.
1895-
* Returns: {boolean} `true` if additional chunks of data may continued to be
1895+
* Returns: {boolean} `true` if additional chunks of data may continue to be
18961896
pushed; `false` otherwise.
18971897

18981898
When `chunk` is a `Buffer`, `Uint8Array` or `string`, the `chunk` of data will
@@ -2305,7 +2305,7 @@ The `callback` function must be called only when the current chunk is completely
23052305
consumed. The first argument passed to the `callback` must be an `Error` object
23062306
if an error occurred while processing the input or `null` otherwise. If a second
23072307
argument is passed to the `callback`, it will be forwarded on to the
2308-
`readable.push()` method. In other words the following are equivalent:
2308+
`readable.push()` method. In other words, the following are equivalent:
23092309

23102310
```js
23112311
transform.prototype._transform = function(data, encoding, callback) {
@@ -2352,7 +2352,7 @@ less powerful and less useful.
23522352
guaranteed. This meant that it was still necessary to be prepared to receive
23532353
[`'data'`][] events *even when the stream was in a paused state*.
23542354

2355-
In Node.js 0.10, the [`Readable`][] class was added. For backwards
2355+
In Node.js 0.10, the [`Readable`][] class was added. For backward
23562356
compatibility with older Node.js programs, `Readable` streams switch into
23572357
"flowing mode" when a [`'data'`][] event handler is added, or when the
23582358
[`stream.resume()`][stream-resume] method is called. The effect is that, even

0 commit comments

Comments
 (0)