@@ -1244,13 +1244,15 @@ changes:
1244
1244
description: The `chunk` argument can now be a `Uint8Array` instance.
1245
1245
-->
1246
1246
1247
- * ` chunk ` {Buffer|Uint8Array|string|any} Chunk of data to unshift onto the
1247
+ * ` chunk ` {Buffer|Uint8Array|string|null| any} Chunk of data to unshift onto the
1248
1248
read queue. For streams not operating in object mode, ` chunk ` must be a
1249
1249
string, ` Buffer ` or ` Uint8Array ` . For object mode streams, ` chunk ` may be
1250
1250
any JavaScript value other than ` null ` .
1251
1251
* ` encoding ` {string} Encoding of string chunks. Must be a valid
1252
1252
` Buffer ` encoding, such as ` 'utf8' ` or ` 'ascii' ` .
1253
1253
1254
+ Passing chunk as null signals the end of the stream (EOF), after which no more data can be written.
1255
+
1254
1256
The ` readable.unshift() ` method pushes a chunk of data back into the internal
1255
1257
buffer. This is useful in certain situations where a stream is being consumed by
1256
1258
code that needs to "un-consume" some amount of data that it has optimistically
@@ -2028,7 +2030,7 @@ changes:
2028
2030
* ` chunk ` {Buffer|Uint8Array|string|null|any} Chunk of data to push into the
2029
2031
read queue. For streams not operating in object mode, ` chunk ` must be a
2030
2032
string, ` Buffer ` or ` Uint8Array ` . For object mode streams, ` chunk ` may be
2031
- any JavaScript value.
2033
+ any JavaScript value other than ` null ` . .
2032
2034
* ` encoding ` {string} Encoding of string chunks. Must be a valid
2033
2035
` Buffer ` encoding, such as ` 'utf8' ` or ` 'ascii' ` .
2034
2036
* Returns: {boolean} ` true ` if additional chunks of data may continue to be
0 commit comments