Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2021-07-30 15:18:38 +0300
committerRich Trott <rtrott@gmail.com>2021-08-02 15:59:18 +0300
commitac621ff5e76469db2ec97d0b1d48c765a5fd29de (patch)
treed1b9c4f54bf77d1968b54d14efb1db43ed89b8cb /doc/api
parent45f98fc60d12ca97ebeb35974ad966547990eda4 (diff)
stream: add readableDidRead if has been read from
Adds did read accessor used to determine whether a readable has been read from. PR-URL: https://github.com/nodejs/node/pull/39589 Refs: https://github.com/nodejs/undici/pull/907 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/stream.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md
index fc66885ebc9..312f200e61c 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -1261,6 +1261,17 @@ added: v11.4.0
Is `true` if it is safe to call [`readable.read()`][stream-read], which means
the stream has not been destroyed or emitted `'error'` or `'end'`.
+##### `readable.readableDidRead`
+<!-- YAML
+added: REPLACEME
+-->
+
+* {boolean}
+
+Allows determining if the stream has been or is about to be read.
+Returns true if `'data'`, `'end'`, `'error'` or `'close'` has been
+emitted.
+
##### `readable.readableEncoding`
<!-- YAML
added: v12.7.0