Skip to content

Commit 68b7c80

Browse files
karan1205BethGriggs
authored andcommitted
doc: fix usage of folder and directory terms in fs.md
This commit fixes the interchangeably usage of "folder" and "directory" terms in fs.md Fixes: #32902 PR-URL: #32919 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 57c170c commit 68b7c80

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

doc/api/fs.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -2459,11 +2459,11 @@ changes:
24592459
Asynchronously creates a directory.
24602460

24612461
The callback is given a possible exception and, if `recursive` is `true`, the
2462-
first folder path created, `(err, [path])`.
2462+
first directory path created, `(err, [path])`.
24632463

24642464
The optional `options` argument can be an integer specifying `mode` (permission
24652465
and sticky bits), or an object with a `mode` property and a `recursive`
2466-
property indicating whether parent folders should be created. Calling
2466+
property indicating whether parent directories should be created. Calling
24672467
`fs.mkdir()` when `path` is a directory that exists results in an error only
24682468
when `recursive` is false.
24692469

@@ -2509,7 +2509,7 @@ changes:
25092509
* Returns: {string|undefined}
25102510

25112511
Synchronously creates a directory. Returns `undefined`, or if `recursive` is
2512-
`true`, the first folder path created.
2512+
`true`, the first directory path created.
25132513
This is the synchronous version of [`fs.mkdir()`][].
25142514

25152515
See also: mkdir(2).
@@ -2536,7 +2536,7 @@ changes:
25362536
* `encoding` {string} **Default:** `'utf8'`
25372537
* `callback` {Function}
25382538
* `err` {Error}
2539-
* `folder` {string}
2539+
* `directory` {string}
25402540

25412541
Creates a unique temporary directory.
25422542

@@ -2546,16 +2546,16 @@ inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
25462546
notably the BSDs, can return more than six random characters, and replace
25472547
trailing `X` characters in `prefix` with random characters.
25482548

2549-
The created folder path is passed as a string to the callback's second
2549+
The created directory path is passed as a string to the callback's second
25502550
parameter.
25512551

25522552
The optional `options` argument can be a string specifying an encoding, or an
25532553
object with an `encoding` property specifying the character encoding to use.
25542554

25552555
```js
2556-
fs.mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, folder) => {
2556+
fs.mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => {
25572557
if (err) throw err;
2558-
console.log(folder);
2558+
console.log(directory);
25592559
// Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
25602560
});
25612561
```
@@ -2571,19 +2571,19 @@ must end with a trailing platform-specific path separator
25712571
const tmpDir = os.tmpdir();
25722572

25732573
// This method is *INCORRECT*:
2574-
fs.mkdtemp(tmpDir, (err, folder) => {
2574+
fs.mkdtemp(tmpDir, (err, directory) => {
25752575
if (err) throw err;
2576-
console.log(folder);
2576+
console.log(directory);
25772577
// Will print something similar to `/tmpabc123`.
25782578
// A new temporary directory is created at the file system root
25792579
// rather than *within* the /tmp directory.
25802580
});
25812581

25822582
// This method is *CORRECT*:
25832583
const { sep } = require('path');
2584-
fs.mkdtemp(`${tmpDir}${sep}`, (err, folder) => {
2584+
fs.mkdtemp(`${tmpDir}${sep}`, (err, directory) => {
25852585
if (err) throw err;
2586-
console.log(folder);
2586+
console.log(directory);
25872587
// Will print something similar to `/tmp/abc123`.
25882588
// A new temporary directory is created within
25892589
// the /tmp directory.
@@ -2600,7 +2600,7 @@ added: v5.10.0
26002600
* `encoding` {string} **Default:** `'utf8'`
26012601
* Returns: {string}
26022602

2603-
Returns the created folder path.
2603+
Returns the created directory path.
26042604

26052605
For detailed information, see the documentation of the asynchronous version of
26062606
this API: [`fs.mkdtemp()`][].
@@ -3465,7 +3465,7 @@ error raised if the file is not available.
34653465
To check if a file exists without manipulating it afterwards, [`fs.access()`][]
34663466
is recommended.
34673467

3468-
For example, given the following folder structure:
3468+
For example, given the following directory structure:
34693469

34703470
```fundamental
34713471
- txtDir
@@ -4972,11 +4972,11 @@ added: v10.0.0
49724972
* Returns: {Promise}
49734973

49744974
Asynchronously creates a directory then resolves the `Promise` with either no
4975-
arguments, or the first folder path created if `recursive` is `true`.
4975+
arguments, or the first directory path created if `recursive` is `true`.
49764976

49774977
The optional `options` argument can be an integer specifying `mode` (permission
49784978
and sticky bits), or an object with a `mode` property and a `recursive`
4979-
property indicating whether parent folders should be created. Calling
4979+
property indicating whether parent directories should be created. Calling
49804980
`fsPromises.mkdir()` when `path` is a directory that exists results in a
49814981
rejection only when `recursive` is false.
49824982

@@ -4991,7 +4991,7 @@ added: v10.0.0
49914991
* Returns: {Promise}
49924992

49934993
Creates a unique temporary directory and resolves the `Promise` with the created
4994-
folder path. A unique directory name is generated by appending six random
4994+
directory path. A unique directory name is generated by appending six random
49954995
characters to the end of the provided `prefix`. Due to platform
49964996
inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
49974997
notably the BSDs, can return more than six random characters, and replace

0 commit comments

Comments
 (0)