From 77abca991a554e4fbdee778b858f633d8b879b22 Mon Sep 17 00:00:00 2001 From: bcheidemann Date: Sat, 5 Jun 2021 18:06:35 +0100 Subject: [PATCH] docs: format fs.readdir documentation section --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8227a1d..67a76a6 100644 --- a/README.md +++ b/README.md @@ -870,7 +870,11 @@ fs.readdir('/docs', function(err, files) { }); ``` -Optionally accepts an options parameter, which can be either an encoding (e.g. "utf8") or an object with optional properties `encoding` and `withFileTypes`. The `encoding` property is a `string` which will determine the character encoding to use for the names of each directory entry. The `withFileTypes` property is a `boolean` which defaults to `false`. If `true`, this method will return an array of [fs.Dirent](https://nodejs.org/api/fs.html#fs_class_fs_dirent) objects. The `name` property on the [fs.Dirent](https://nodejs.org/api/fs.html#fs_class_fs_dirent) object will be encoded using the specified character encoding. +Optionally accepts an options parameter, which can be either an encoding (e.g. "utf8") or an object with optional properties `encoding` and `withFileTypes`. + +The `encoding` property is a `string` which will determine the character encoding to use for the names of each directory entry. The `withFileTypes` property is a `boolean` which defaults to `false`. If `true`, this method will return an array of [fs.Dirent](https://nodejs.org/api/fs.html#fs_class_fs_dirent) objects. + +The `name` property on the [fs.Dirent](https://nodejs.org/api/fs.html#fs_class_fs_dirent) objects will be encoded using the specified character encoding. #### fs.close(fd, callback)