From 6c430b48b9dff238995aeffe3626bd8b156f563d Mon Sep 17 00:00:00 2001 From: ZYSzys Date: Fri, 5 Jul 2019 15:54:34 +0800 Subject: [PATCH] stream: use readableEncoding public api for child_process PR-URL: https://github.com/nodejs/node/pull/28548 Refs: https://github.com/nodejs/node/issues/445 Reviewed-By: Matteo Collina Reviewed-By: Rich Trott --- doc/api/stream.md | 11 +++++++++++ lib/_stream_readable.js | 7 +++++++ lib/child_process.js | 10 ++++------ test/parallel/test-stream2-basic.js | 12 ++++++++++++ 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 16edb6d80ba310..c0a14c7aaa359f 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1085,6 +1085,16 @@ added: v11.4.0 Is `true` if it is safe to call [`readable.read()`][stream-read]. +##### readable.readableEncoding + + +* {null|string} + +Getter for the property `encoding` of a given `Readable` stream. The `encoding` +property can be set using the [`readable.setEncoding()`][] method. + ##### readable.readableHighWaterMark