Skip to content

Commit 8c357a6

Browse files
chrisneavejasnell
authored andcommitted
docs: Fix default options for fs.createWriteStream()
The documentation for createWriteStream() references an 'encoding' property that has a default value of null. However, this property is never referenced by createWriteStream() or WritableState(). Instead a 'defaultEncoding' property is referenced in WritableState() with a default of 'utf8' if no value is supplied. This fix updates the documentation to rename the 'encoding' property to 'defaultEncoding' and indicate its default value of 'utf8'. Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs#25565
1 parent e9bf57e commit 8c357a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/fs.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ Returns a new WriteStream object (See `Writable Stream`).
823823
`options` is an object with the following defaults:
824824

825825
{ flags: 'w',
826-
encoding: null,
826+
defaultEncoding: 'utf8',
827827
fd: null,
828828
mode: 0666 }
829829

0 commit comments

Comments
 (0)