Skip to content

Commit

Permalink
doc: clarify behavior of fs.mkdir
Browse files Browse the repository at this point in the history
PR-URL: #27505
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Gaelan authored and targos committed May 20, 2019
1 parent e61823c commit 1f7a527
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1f7a527

Please sign in to comment.