From e96c11c384dce60de44f71bb88c102dfdb2de3c1 Mon Sep 17 00:00:00 2001 From: Aleh Zasypkin Date: Wed, 16 Aug 2017 19:32:54 +0200 Subject: [PATCH] doc,fs: rename defaultEncoding option to encoding The documentation for `fs.createWriteStream()` references a `defaultEncoding` as possible options property, but in reality `encoding` property is expected and properly handled. This fix updates the documentation to rename the `defaultEncoding` property to `encoding`. PR-URL: https://github.com/nodejs/node/pull/14867 Fixes: https://github.com/nodejs/node/issues/14611 Reviewed-By: Luigi Pinca Reviewed-By: Refael Ackermann Reviewed-By: Matteo Collina Reviewed-By: James M Snell --- doc/api/fs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index db5509e4fd..9985858aca 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -835,7 +835,7 @@ changes: * `path` {string|Buffer|URL} * `options` {string|Object} * `flags` {string} - * `defaultEncoding` {string} + * `encoding` {string} * `fd` {integer} * `mode` {integer} * `autoClose` {boolean} @@ -848,7 +848,7 @@ Returns a new [`WriteStream`][] object. (See [Writable Stream][]). ```js const defaults = { flags: 'w', - defaultEncoding: 'utf8', + encoding: 'utf8', fd: null, mode: 0o666, autoClose: true @@ -858,7 +858,7 @@ const defaults = { `options` may also include a `start` option to allow writing data at some position past the beginning of the file. Modifying a file rather than replacing it may require a `flags` mode of `r+` rather than the -default mode `w`. The `defaultEncoding` can be any one of those accepted by +default mode `w`. The `encoding` can be any one of those accepted by [`Buffer`][]. If `autoClose` is set to true (default behavior) on `error` or `end`