File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3179,19 +3179,20 @@ Asynchronously creates a directory.
31793179The callback is given a possible exception and, if `recursive` is `true`, the
31803180first directory path created, `(err[, path])`.
31813181`path` can still be `undefined` when `recursive` is `true`, if no directory was
3182- created.
3182+ created (for instance, if it was previously created) .
31833183
31843184The optional `options` argument can be an integer specifying `mode` (permission
31853185and sticky bits), or an object with a `mode` property and a `recursive`
31863186property indicating whether parent directories should be created. Calling
31873187`fs.mkdir()` when `path` is a directory that exists results in an error only
3188- when `recursive` is false.
3188+ when `recursive` is false. If `recursive` is false and the directory exists,
3189+ an `EEXIST` error occurs.
31893190
31903191```mjs
31913192import { mkdir } from 'node:fs';
31923193
3193- // Creates /tmp/a/apple, regardless of whether ` /tmp` and /tmp/a exist.
3194- mkdir('/tmp/a/apple', { recursive: true }, (err) => {
3194+ // Create . /tmp/a/apple, regardless of whether . /tmp and . /tmp/a exist.
3195+ mkdir('. /tmp/a/apple', { recursive: true }, (err) => {
31953196 if (err) throw err;
31963197});
31973198```
You can’t perform that action at this time.
0 commit comments