From e283206047946f23d328028e5da86afa41a9e4aa Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 3 Oct 2018 13:32:26 -0700 Subject: [PATCH] doc: improve `stream.Writable` ctor encoding option docs - Document `defaultEncoding`. This was previously undocumented. - Clarify `decodeStrings`. In particular, the previous description was talking about decoding, which matches the unfortunate option name, but what actually happens is usually refererred to as encoding a string into a binary form. PR-URL: https://github.com/nodejs/node/pull/23246 Reviewed-By: Luigi Pinca Reviewed-By: Vse Mozhet Byt Reviewed-By: Colin Ihrig Reviewed-By: Sakthipriyan Vairamani --- doc/api/stream.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 7a8c3f5199e208..10cdf177b86658 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1491,9 +1491,13 @@ changes: * `highWaterMark` {number} Buffer level when [`stream.write()`][stream-write] starts returning `false`. **Default:** `16384` (16kb), or `16` for `objectMode` streams. - * `decodeStrings` {boolean} Whether or not to decode strings into - `Buffer`s before passing them to [`stream._write()`][stream-_write]. + * `decodeStrings` {boolean} Whether or not to encode strings as + `Buffer`s before passing them to [`stream._write()`][stream-_write], + using the encoding specified in the [`stream.write()`][stream-write] call. **Default:** `true`. + * `defaultEncoding` {string} The default encoding that is used when no + encoding is specified as an argument to [`stream.write()`][stream-write]. + **Default:** `'utf8'`. * `objectMode` {boolean} Whether or not the [`stream.write(anyObj)`][stream-write] is a valid operation. When set, it becomes possible to write JavaScript values other than string,