mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
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: https://github.com/nodejs/node/issues/32902 PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
c3554307c6
commit
b53cae32d3
1 file changed
+16
-16
+16
-16
@@ -2459,11 +2459,11 @@ changes:
|
||||
Asynchronously creates a directory.
|
||||
|
||||
The callback is given a possible exception and, if `recursive` is `true`, the
|
||||
first folder path created, `(err, [path])`.
|
||||
first directory path created, `(err, [path])`.
|
||||
|
||||
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. Calling
|
||||
property indicating whether parent directories should be created. Calling
|
||||
`fs.mkdir()` when `path` is a directory that exists results in an error only
|
||||
when `recursive` is false.
|
||||
|
||||
@@ -2509,7 +2509,7 @@ changes:
|
||||
* Returns: {string|undefined}
|
||||
|
||||
Synchronously creates a directory. Returns `undefined`, or if `recursive` is
|
||||
`true`, the first folder path created.
|
||||
`true`, the first directory path created.
|
||||
This is the synchronous version of [`fs.mkdir()`][].
|
||||
|
||||
See also: mkdir(2).
|
||||
@@ -2536,7 +2536,7 @@ changes:
|
||||
* `encoding` {string} **Default:** `'utf8'`
|
||||
* `callback` {Function}
|
||||
* `err` {Error}
|
||||
* `folder` {string}
|
||||
* `directory` {string}
|
||||
|
||||
Creates a unique temporary directory.
|
||||
|
||||
@@ -2546,16 +2546,16 @@ inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
|
||||
notably the BSDs, can return more than six random characters, and replace
|
||||
trailing `X` characters in `prefix` with random characters.
|
||||
|
||||
The created folder path is passed as a string to the callback's second
|
||||
The created directory path is passed as a string to the callback's second
|
||||
parameter.
|
||||
|
||||
The optional `options` argument can be a string specifying an encoding, or an
|
||||
object with an `encoding` property specifying the character encoding to use.
|
||||
|
||||
```js
|
||||
fs.mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, folder) => {
|
||||
fs.mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => {
|
||||
if (err) throw err;
|
||||
console.log(folder);
|
||||
console.log(directory);
|
||||
// Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
|
||||
});
|
||||
```
|
||||
@@ -2571,9 +2571,9 @@ must end with a trailing platform-specific path separator
|
||||
const tmpDir = os.tmpdir();
|
||||
|
||||
// This method is *INCORRECT*:
|
||||
fs.mkdtemp(tmpDir, (err, folder) => {
|
||||
fs.mkdtemp(tmpDir, (err, directory) => {
|
||||
if (err) throw err;
|
||||
console.log(folder);
|
||||
console.log(directory);
|
||||
// Will print something similar to `/tmpabc123`.
|
||||
// A new temporary directory is created at the file system root
|
||||
// rather than *within* the /tmp directory.
|
||||
@@ -2581,9 +2581,9 @@ fs.mkdtemp(tmpDir, (err, folder) => {
|
||||
|
||||
// This method is *CORRECT*:
|
||||
const { sep } = require('path');
|
||||
fs.mkdtemp(`${tmpDir}${sep}`, (err, folder) => {
|
||||
fs.mkdtemp(`${tmpDir}${sep}`, (err, directory) => {
|
||||
if (err) throw err;
|
||||
console.log(folder);
|
||||
console.log(directory);
|
||||
// Will print something similar to `/tmp/abc123`.
|
||||
// A new temporary directory is created within
|
||||
// the /tmp directory.
|
||||
@@ -2600,7 +2600,7 @@ added: v5.10.0
|
||||
* `encoding` {string} **Default:** `'utf8'`
|
||||
* Returns: {string}
|
||||
|
||||
Returns the created folder path.
|
||||
Returns the created directory path.
|
||||
|
||||
For detailed information, see the documentation of the asynchronous version of
|
||||
this API: [`fs.mkdtemp()`][].
|
||||
@@ -3465,7 +3465,7 @@ error raised if the file is not available.
|
||||
To check if a file exists without manipulating it afterwards, [`fs.access()`][]
|
||||
is recommended.
|
||||
|
||||
For example, given the following folder structure:
|
||||
For example, given the following directory structure:
|
||||
|
||||
```fundamental
|
||||
- txtDir
|
||||
@@ -4972,11 +4972,11 @@ added: v10.0.0
|
||||
* Returns: {Promise}
|
||||
|
||||
Asynchronously creates a directory then resolves the `Promise` with either no
|
||||
arguments, or the first folder path created if `recursive` is `true`.
|
||||
arguments, or the first directory path created if `recursive` is `true`.
|
||||
|
||||
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. Calling
|
||||
property indicating whether parent directories should be created. Calling
|
||||
`fsPromises.mkdir()` when `path` is a directory that exists results in a
|
||||
rejection only when `recursive` is false.
|
||||
|
||||
@@ -4991,7 +4991,7 @@ added: v10.0.0
|
||||
* Returns: {Promise}
|
||||
|
||||
Creates a unique temporary directory and resolves the `Promise` with the created
|
||||
folder path. A unique directory name is generated by appending six random
|
||||
directory path. A unique directory name is generated by appending six random
|
||||
characters to the end of the provided `prefix`. Due to platform
|
||||
inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
|
||||
notably the BSDs, can return more than six random characters, and replace
|
||||
|
||||
Reference in new issue
Block a user