From 1808572414a60f64986ea9b6ba88ae2630ddcce2 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sat, 13 Nov 2021 15:08:14 +0200 Subject: [PATCH] stream: add writableAborted PR-URL: https://github.com/nodejs/node/pull/40802 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- doc/api/stream.md | 12 +++++++++ lib/internal/streams/writable.js | 20 +++++++++++++- test/parallel/test-stream-writable-aborted.js | 26 +++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-stream-writable-aborted.js diff --git a/doc/api/stream.md b/doc/api/stream.md index 3771b66f4e8375..fef8df8ea53b7d 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -586,6 +586,18 @@ added: v11.4.0 Is `true` if it is safe to call [`writable.write()`][stream-write], which means the stream has not been destroyed, errored or ended. +##### `writable.writableAborted` + + + +> Stability: 1 - Experimental + +* {boolean} + +Returns whether the stream was destroyed or errored before emitting `'finish'`. + ##### `writable.writableEnded`