summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2019-10-09 08:45:00 +0200
committerRich Trott <rtrott@gmail.com>2019-11-25 14:35:06 -0800
commitd67c37725adebfbdee6cb78ea4261833448ddf4c (patch)
tree6f38ab2c9bf1354195277ca56fc6ce02e8a5ab6d /doc
parenta50cc2ed0eecf89713ea11c64b00dee416c88362 (diff)
downloadandroid-node-v8-d67c37725adebfbdee6cb78ea4261833448ddf4c.tar.gz
android-node-v8-d67c37725adebfbdee6cb78ea4261833448ddf4c.tar.bz2
android-node-v8-d67c37725adebfbdee6cb78ea4261833448ddf4c.zip
doc: add note of caution about non-conforming streams
PR-URL: https://github.com/nodejs/node/pull/29895 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/stream.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md
index 2143a84926..4e3efde075 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -1692,6 +1692,13 @@ of a stream that are intended for use by consumers (as described in the
[API for Stream Consumers][] section). Doing so may lead to adverse side effects
in application code consuming the stream.
+Avoid overriding public methods such as `write()`, `end()`, `cork()`,
+`uncork()`, `read()` and `destroy()`, or emitting internal events such
+as `'error'`, `'data'`, `'end'`, `'finish'` and `'close'` through `.emit()`.
+Doing so can break current and future stream invariants leading to behavior
+and/or compatibility issues with other streams, stream utilities, and user
+expectations.
+
### Simplified Construction
<!-- YAML
added: v1.2.0