diff options
author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2021-08-21 18:13:42 +0300 |
---|---|---|
committer | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2021-08-30 01:45:37 +0300 |
commit | 52abf271c563ddffdc93b444ea05e5347a7f2784 (patch) | |
tree | b27cc363bbc47e1576792c409ddaffbb6e38a6dd /doc/api | |
parent | 6fdd5827f0956ffc4e7ffe31babaf530e42f75b9 (diff) |
fs: add docs and tests for `AsyncIterable` support in `fh.writeFile`
Refs: https://github.com/nodejs/node/pull/37490
PR-URL: https://github.com/nodejs/node/pull/39836
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/fs.md | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index 687ece15f01..f41ebdf56ce 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -545,6 +545,9 @@ the end of the file. <!-- YAML added: v10.0.0 changes: + - version: v15.14.0 + pr-url: https://github.com/nodejs/node/pull/37490 + description: The `data` argument supports `AsyncIterable`, `Iterable` and `Stream`. - version: v14.12.0 pr-url: https://github.com/nodejs/node/pull/34993 description: The `data` parameter will stringify an object with an @@ -555,14 +558,16 @@ changes: strings anymore. --> -* `data` {string|Buffer|TypedArray|DataView|Object} +* `data` {string|Buffer|TypedArray|DataView|Object|AsyncIterable|Iterable + |Stream} * `options` {Object|string} * `encoding` {string|null} The expected character encoding when `data` is a string. **Default:** `'utf8'` * Returns: {Promise} Asynchronously writes data to a file, replacing the file if it already exists. -`data` can be a string, a buffer, or an object with an own `toString` function +`data` can be a string, a buffer, an {AsyncIterable} or {Iterable} object, or an +object with an own `toString` function property. The promise is resolved with no arguments upon success. If `options` is a string, then it specifies the `encoding`. @@ -1341,7 +1346,7 @@ added: v10.0.0 changes: - version: v15.14.0 pr-url: https://github.com/nodejs/node/pull/37490 - description: The `data` argument supports `AsyncIterable`, `Iterable` & `Stream`. + description: The `data` argument supports `AsyncIterable`, `Iterable` and `Stream`. - version: v15.2.0 pr-url: https://github.com/nodejs/node/pull/35993 description: The options argument may include an AbortSignal to abort an |