Skip to content

Commit 76e960c

Browse files
karan1205BridgeAR
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 <[email protected]> Reviewed-By: Andrey Pechkurov <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent c596759 commit 76e960c

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
@@ -2470,11 +2470,11 @@ changes:
24702470
Asynchronously creates a directory.
24712471

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

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

@@ -2520,7 +2520,7 @@ changes:
25202520
* Returns: {string|undefined}
25212521

25222522
Synchronously creates a directory. Returns `undefined`, or if `recursive` is
2523-
`true`, the first folder path created.
2523+
`true`, the first directory path created.
25242524
This is the synchronous version of [`fs.mkdir()`][].
25252525

25262526
See also: mkdir(2).
@@ -2547,7 +2547,7 @@ changes:
25472547
* `encoding` {string} **Default:** `'utf8'`
25482548
* `callback` {Function}
25492549
* `err` {Error}
2550-
* `folder` {string}
2550+
* `directory` {string}
25512551

25522552
Creates a unique temporary directory.
25532553

@@ -2557,16 +2557,16 @@ inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
25572557
notably the BSDs, can return more than six random characters, and replace
25582558
trailing `X` characters in `prefix` with random characters.
25592559

2560-
The created folder path is passed as a string to the callback's second
2560+
The created directory path is passed as a string to the callback's second
25612561
parameter.
25622562

25632563
The optional `options` argument can be a string specifying an encoding, or an
25642564
object with an `encoding` property specifying the character encoding to use.
25652565

25662566
```js
2567-
fs.mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, folder) => {
2567+
fs.mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => {
25682568
if (err) throw err;
2569-
console.log(folder);
2569+
console.log(directory);
25702570
// Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
25712571
});
25722572
```
@@ -2582,19 +2582,19 @@ must end with a trailing platform-specific path separator
25822582
const tmpDir = os.tmpdir();
25832583

25842584
// This method is *INCORRECT*:
2585-
fs.mkdtemp(tmpDir, (err, folder) => {
2585+
fs.mkdtemp(tmpDir, (err, directory) => {
25862586
if (err) throw err;
2587-
console.log(folder);
2587+
console.log(directory);
25882588
// Will print something similar to `/tmpabc123`.
25892589
// A new temporary directory is created at the file system root
25902590
// rather than *within* the /tmp directory.
25912591
});
25922592

25932593
// This method is *CORRECT*:
25942594
const { sep } = require('path');
2595-
fs.mkdtemp(`${tmpDir}${sep}`, (err, folder) => {
2595+
fs.mkdtemp(`${tmpDir}${sep}`, (err, directory) => {
25962596
if (err) throw err;
2597-
console.log(folder);
2597+
console.log(directory);
25982598
// Will print something similar to `/tmp/abc123`.
25992599
// A new temporary directory is created within
26002600
// the /tmp directory.
@@ -2611,7 +2611,7 @@ added: v5.10.0
26112611
* `encoding` {string} **Default:** `'utf8'`
26122612
* Returns: {string}
26132613

2614-
Returns the created folder path.
2614+
Returns the created directory path.
26152615

26162616
For detailed information, see the documentation of the asynchronous version of
26172617
this API: [`fs.mkdtemp()`][].
@@ -3476,7 +3476,7 @@ error raised if the file is not available.
34763476
To check if a file exists without manipulating it afterwards, [`fs.access()`][]
34773477
is recommended.
34783478

3479-
For example, given the following folder structure:
3479+
For example, given the following directory structure:
34803480

34813481
```fundamental
34823482
- txtDir
@@ -4945,11 +4945,11 @@ added: v10.0.0
49454945
* Returns: {Promise}
49464946

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

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

@@ -4964,7 +4964,7 @@ added: v10.0.0
49644964
* Returns: {Promise}
49654965

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

0 commit comments

Comments
 (0)