diff options
author | Gaelan <gbs@canishe.com> | 2019-05-01 02:12:46 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-05-19 19:35:26 +0300 |
commit | 13d2df530b613f5f41db3e9680fa85d55bea0f1e (patch) | |
tree | 41be119d049b9fab7a37163ad2d247f6bee89b8d | |
parent | 5112b3d9a6645b83b90b559cb388fa29ee61eb99 (diff) |
doc: clarify behavior of fs.mkdir
PR-URL: https://github.com/nodejs/node/pull/27505
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r-- | doc/api/fs.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index 9e3b0df9a48..3b3c6efd582 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2206,7 +2206,9 @@ are given to the completion callback. The optional `options` argument can be an integer specifying mode (permission and sticky bits), or an object with a `mode` property and a `recursive` -property indicating whether parent folders should be created. +property indicating whether parent folders should be created. Calling +`fs.mkdir()` when `path` is a directory that exists results in an error only +when `recursive` is false. ```js // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist. @@ -4288,7 +4290,9 @@ arguments upon success. The optional `options` argument can be an integer specifying mode (permission and sticky bits), or an object with a `mode` property and a `recursive` -property indicating whether parent folders should be created. +property indicating whether parent folders should be created. Calling +`fsPromises.mkdir()` when `path` is a directory that exists results in a +rejection only when `recursive` is false. ### fsPromises.mkdtemp(prefix[, options]) <!-- YAML |