From afe353061b3c0543ebaa40668f27c12384e6c5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Arboleda?= Date: Thu, 26 Dec 2019 13:48:53 -0500 Subject: [PATCH] doc: fs.write is not longer coercing strings PR-URL: https://github.com/nodejs/node/pull/31030 Reviewed-By: Rich Trott Reviewed-By: Yongsheng Zhang Reviewed-By: James M Snell Reviewed-By: Matteo Collina Reviewed-By: Gireesh Punathil --- doc/api/fs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index ad45c7b6865..c8be2df6d01 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3985,7 +3985,7 @@ changes: * `string` {string} Write `string` to the file specified by `fd`. If `string` is not a string, then -the value will be coerced to one. +an exception will be thrown. `position` refers to the offset from the beginning of the file where this data should be written. If `typeof position !== 'number'` the data will be written at @@ -4051,7 +4051,7 @@ changes: * `err` {Error} When `file` is a filename, asynchronously writes data to the file, replacing the -file if it already exists. `data` can be a string or a buffer. +file if it already exists. `data` can be a string or a buffer. When `file` is a file descriptor, the behavior is similar to calling `fs.write()` directly (which is recommended). See the notes below on using