Skip to content

Commit 6f35729

Browse files
azasypkinMylesBorins
authored andcommitted
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: #14867 Fixes: #14611 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 39d5f2f commit 6f35729

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/api/fs.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ changes:
835835
* `path` {string|Buffer|URL}
836836
* `options` {string|Object}
837837
* `flags` {string}
838-
* `defaultEncoding` {string}
838+
* `encoding` {string}
839839
* `fd` {integer}
840840
* `mode` {integer}
841841
* `autoClose` {boolean}
@@ -848,7 +848,7 @@ Returns a new [`WriteStream`][] object. (See [Writable Stream][]).
848848
```js
849849
const defaults = {
850850
flags: 'w',
851-
defaultEncoding: 'utf8',
851+
encoding: 'utf8',
852852
fd: null,
853853
mode: 0o666,
854854
autoClose: true
@@ -858,7 +858,7 @@ const defaults = {
858858
`options` may also include a `start` option to allow writing data at
859859
some position past the beginning of the file. Modifying a file rather
860860
than replacing it may require a `flags` mode of `r+` rather than the
861-
default mode `w`. The `defaultEncoding` can be any one of those accepted by
861+
default mode `w`. The `encoding` can be any one of those accepted by
862862
[`Buffer`][].
863863

864864
If `autoClose` is set to true (default behavior) on `error` or `end`

0 commit comments

Comments
 (0)