From d6188bdd2718c15742c62d38d40919a54d64d44d Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 4 Jul 2011 16:26:46 +0200 Subject: [PATCH] Document behaviour of the `encoding` parameter of fs.writeFile(). Fixes #401. --- doc/api/fs.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index 613c45efd3a..7df7ee11583 100644 --- a/doc/api/fs.markdown +++ b/doc/api/fs.markdown @@ -361,7 +361,8 @@ returns a buffer. ### fs.writeFile(filename, data, encoding='utf8', [callback]) Asynchronously writes data to a file, replacing the file if it already exists. -`data` can be a string or a buffer. +`data` can be a string or a buffer. The `encoding` argument is ignored if +`data` is a buffer. Example: