Skip to content

Commit

Permalink
Update doc/api/fs.md with parents option.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhu256 committed Aug 4, 2021
1 parent a132adb commit ca8deb8
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,10 @@ the error raised if the file is not accessible.
### `fsPromises.appendFile(path, data[, options])`
<!-- YAML
added: v10.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/35775
description: add option `parents`.
-->
* `path` {string|Buffer|URL|FileHandle} filename or {FileHandle}
Expand All @@ -652,6 +656,8 @@ added: v10.0.0
* `encoding` {string|null} **Default:** `'utf8'`
* `mode` {integer} **Default:** `0o666`
* `flag` {string} See [support of file system `flags`][]. **Default:** `'a'`.
* `parents` {boolean} create parent-directories if they do not exist.
**Default:** `false`.
* Returns: {Promise} Fulfills with `undefined` upon success.
Asynchronously append data to a file, creating the file if it does not yet
Expand Down Expand Up @@ -903,6 +909,25 @@ by [Naming Files, Paths, and Namespaces][]. Under NTFS, if the filename contains
a colon, Node.js will open a file system stream, as described by
[this MSDN page][MSDN-Using-Streams].
### `fsPromises.open(path[, options])`
<!-- YAML
added: REPLACEME
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/35775
description: add option `parents`.
-->
* `path` {string|Buffer|URL}
* `options` {Object|string}
* `flags` {string|number} See [support of file system `flags`][].
**Default:** `'r'`.
* `mode` {string|integer} **Default:** `0o666` (readable and writable)
* `parents` {boolean} create parent-directories if they do not exist.
**Default:** `false`.
Asynchronous file open that returns a `Promise` using `options` signature-form.
### `fsPromises.opendir(path[, options])`
<!-- YAML
added: v12.12.0
Expand Down Expand Up @@ -1305,6 +1330,9 @@ All the [caveats][] for `fs.watch()` also apply to `fsPromises.watch()`.
<!-- YAML
added: v10.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/35775
description: add option `parents`.
- version: v15.14.0
pr-url: https://github.com/nodejs/node/pull/37490
description: The `data` argument supports `AsyncIterable`, `Iterable` & `Stream`.
Expand All @@ -1329,6 +1357,8 @@ changes:
* `encoding` {string|null} **Default:** `'utf8'`
* `mode` {integer} **Default:** `0o666`
* `flag` {string} See [support of file system `flags`][]. **Default:** `'w'`.
* `parents` {boolean} create parent-directories if they do not exist.
**Default:** `false`.
* `signal` {AbortSignal} allows aborting an in-progress writeFile
* Returns: {Promise} Fulfills with `undefined` upon success.
Expand Down Expand Up @@ -1578,6 +1608,9 @@ the user from reading or writing to it.
<!-- YAML
added: v0.6.7
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/35775
description: add option `parents`.
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/12562
description: The `callback` parameter is no longer optional. Not passing
Expand All @@ -1600,6 +1633,8 @@ changes:
* `encoding` {string|null} **Default:** `'utf8'`
* `mode` {integer} **Default:** `0o666`
* `flag` {string} See [support of file system `flags`][]. **Default:** `'a'`.
* `parents` {boolean} create parent-directories if they do not exist.
**Default:** `false`.
* `callback` {Function}
* `err` {Error}
Expand Down Expand Up @@ -2737,6 +2772,28 @@ a colon, Node.js will open a file system stream, as described by
Functions based on `fs.open()` exhibit this behavior as well:
`fs.writeFile()`, `fs.readFile()`, etc.
### `fs.open(path[, options], callback)`
<!-- YAML
added: REPLACEME
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/35775
description: add option `parents`.
-->
* `path` {string|Buffer|URL}
* `options` {Object|string}
* `flags` {string|number} See [support of file system `flags`][].
**Default:** `'r'`.
* `mode` {string|integer} **Default:** `0o666` (readable and writable)
* `parents` {boolean} create parent-directories if they do not exist.
**Default:** `false`.
* `callback` {Function}
* `err` {Error}
* `fd` {integer}
Asynchronous file open using `options` signature-form.
### `fs.opendir(path[, options], callback)`
<!-- YAML
added: v12.12.0
Expand Down Expand Up @@ -3956,6 +4013,9 @@ details.
<!-- YAML
added: v0.1.29
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/35775
description: add option `parents`.
- version: v16.0.0
pr-url: https://github.com/nodejs/node/pull/37460
description: The error returned may be an `AggregateError` if more than one
Expand Down Expand Up @@ -4000,6 +4060,8 @@ changes:
* `encoding` {string|null} **Default:** `'utf8'`
* `mode` {integer} **Default:** `0o666`
* `flag` {string} See [support of file system `flags`][]. **Default:** `'w'`.
* `parents` {boolean} create parent-directories if they do not exist.
**Default:** `false`.
* `signal` {AbortSignal} allows aborting an in-progress writeFile
* `callback` {Function}
* `err` {Error|AggregateError}
Expand Down Expand Up @@ -4169,6 +4231,9 @@ try {
<!-- YAML
added: v0.6.7
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/35775
description: add option `parents`.
- version: v7.0.0
pr-url: https://github.com/nodejs/node/pull/7831
description: The passed `options` object will never be modified.
Expand All @@ -4183,6 +4248,8 @@ changes:
* `encoding` {string|null} **Default:** `'utf8'`
* `mode` {integer} **Default:** `0o666`
* `flag` {string} See [support of file system `flags`][]. **Default:** `'a'`.
* `parents` {boolean} create parent-directories if they do not exist.
**Default:** `false`.
Synchronously append data to a file, creating the file if it does not yet
exist. `data` can be a string or a {Buffer}.
Expand Down Expand Up @@ -4648,6 +4715,25 @@ Returns an integer representing the file descriptor.
For detailed information, see the documentation of the asynchronous version of
this API: [`fs.open()`][].
## `fs.openSync(path[, options])`
<!-- YAML
added: REPLACEME
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/35775
description: add option `parents`.
-->
* `path` {string|Buffer|URL}
* `options` {Object|string}
* `flags` {string|number} See [support of file system `flags`][].
**Default:** `'r'`.
* `mode` {string|integer} **Default:** `0o666` (readable and writable)
* `parents` {boolean} create parent-directories if they do not exist.
**Default:** `false`.
Synchronous file open using `options` signature-form.
### `fs.readdirSync(path[, options])`
<!-- YAML
added: v0.1.21
Expand Down Expand Up @@ -5079,6 +5165,9 @@ this API: [`fs.utimes()`][].
<!-- YAML
added: v0.1.29
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/35775
description: add option `parents`.
- version: v14.12.0
pr-url: https://github.com/nodejs/node/pull/34993
description: The `data` parameter will stringify an object with an
Expand All @@ -5105,6 +5194,8 @@ changes:
* `encoding` {string|null} **Default:** `'utf8'`
* `mode` {integer} **Default:** `0o666`
* `flag` {string} See [support of file system `flags`][]. **Default:** `'w'`.
* `parents` {boolean} create parent-directories if they do not exist.
**Default:** `false`.
Returns `undefined`.
Expand Down

0 comments on commit ca8deb8

Please sign in to comment.