@@ -257,18 +257,20 @@ added: v10.0.0
257257added: v10.0.0
258258-->
259259
260- * ` buffer` {Buffer|Uint8Array } A buffer that will be filled with the file
261- data read.
260+ * ` buffer` {Buffer|TypedArray|DataView } A buffer that will be filled with the
261+ file data read.
262262* ` offset` {integer} The location in the buffer at which to start filling.
263263 **Default:** ` 0 `
264- * ` length` {integer} The number of bytes to read. **Default:** ` buffer .length `
264+ * ` length` {integer} The number of bytes to read. **Default:**
265+ ` buffer .byteLength `
265266* ` position` {integer} The location where to begin reading data from the
266267 file. If ` null ` , data will be read from the current file position, and
267268 the position will be updated. If ` position` is an integer, the current
268269 file position will remain unchanged.
269270* Returns: {Promise} Fulfills upon success with an object with two properties:
270271 * ` bytesRead` {integer} The number of bytes read
271- * ` buffer` {Buffer|Uint8Array} A reference to the passed in ` buffer` argument.
272+ * ` buffer` {Buffer|TypedArray|DataView} A reference to the passed in ` buffer`
273+ argument.
272274
273275Reads data from the file and stores that in the given buffer.
274276
@@ -282,19 +284,20 @@ added:
282284 - v12.17.0
283285-->
284286* ` options` {Object}
285- * ` buffer` {Buffer|Uint8Array } A buffer that will be filled with the file
286- data read. **Default:** ` Buffer .alloc (16384 )`
287+ * ` buffer` {Buffer|TypedArray|DataView } A buffer that will be filled with the
288+ file data read. **Default:** ` Buffer .alloc (16384 )`
287289 * ` offset` {integer} The location in the buffer at which to start filling.
288290 **Default:** ` 0 `
289- * ` length` {integer} The number of bytes to read. **Default:** ` buffer .length `
291+ * ` length` {integer} The number of bytes to read. **Default:**
292+ ` buffer .byteLength `
290293 * ` position` {integer} The location where to begin reading data from the
291294 file. If ` null ` , data will be read from the current file position, and
292295 the position will be updated. If ` position` is an integer, the current
293296 file position will remain unchanged. **Default:**: ` null `
294297* Returns: {Promise} Fulfills upon success with an object with two properties:
295298 * ` bytesRead` {integer} The number of bytes read
296- * ` buffer` {Buffer|Uint8Array } A reference to the passed in ` buffer`
297- argument.
299+ * ` buffer` {Buffer|TypedArray|DataView } A reference to the passed in ` buffer`
300+ argument.
298301
299302Reads data from the file and stores that in the given buffer.
300303
@@ -429,10 +432,11 @@ changes:
429432 buffers anymore.
430433-->
431434
432- * ` buffer` {Buffer|Uint8Array |string|Object}
435+ * ` buffer` {Buffer|TypedArray|DataView |string|Object}
433436* ` offset` {integer} The start position from within ` buffer` where the data
434- to write begins.
435- * ` length` {integer} The number of bytes from ` buffer` to write.
437+ to write begins. **Default:** ` 0 `
438+ * ` length` {integer} The number of bytes from ` buffer` to write. **Default:**
439+ ` buffer .byteLength `
436440* ` position` {integer} The offset from the beginning of the file where the
437441 data from ` buffer` should be written. If ` position` is not a ` number` ,
438442 the data will be written at the current position. See the POSIX pwrite(2)
@@ -444,8 +448,8 @@ Write `buffer` to the file.
444448The promise is resolved with an object containing two properties:
445449
446450* ` bytesWritten` {integer} the number of bytes written
447- * ` buffer` {Buffer|Uint8Array| string|Object} a reference to the ` buffer `
448- written.
451+ * ` buffer` {Buffer|TypedArray|DataView| string|Object} a reference to the
452+ ` buffer ` written.
449453
450454It is unsafe to use ` filehandle .write ()` multiple times on the same file
451455without waiting for the promise to be resolved (or rejected). For this
@@ -510,7 +514,7 @@ changes:
510514 strings anymore.
511515-->
512516
513- * ` data` {string|Buffer|Uint8Array |Object|AsyncIterable|Iterable
517+ * ` data` {string|Buffer|TypedArray|DataView |Object|AsyncIterable|Iterable
514518 |Stream}
515519* ` options` {Object|string}
516520 * ` encoding` {string|null} The expected character encoding when ` data` is a
@@ -1263,7 +1267,7 @@ changes:
12631267-->
12641268
12651269* `file` {string|Buffer|URL|FileHandle} filename or `FileHandle`
1266- * `data` {string|Buffer|Uint8Array |Object|AsyncIterable|Iterable
1270+ * `data` {string|Buffer|TypedArray|DataView |Object|AsyncIterable|Iterable
12671271 |Stream}
12681272* `options` {Object|string}
12691273 * `encoding` {string|null} **Default:** `'utf8'`
@@ -2709,9 +2713,11 @@ changes:
27092713
27102714* ` fd` {integer}
27112715* ` buffer` {Buffer|TypedArray|DataView} The buffer that the data will be
2712- written to.
2713- * ` offset` {integer} The position in ` buffer` to write the data to.
2714- * ` length` {integer} The number of bytes to read.
2716+ written to. **Default:** ` Buffer .alloc (16384 )`
2717+ * ` offset` {integer} The position in ` buffer` to write the data to. **Default:**
2718+ ` 0 `
2719+ * ` length` {integer} The number of bytes to read. **Default:**
2720+ ` buffer .byteLength `
27152721* ` position` {integer|bigint} Specifies where to begin reading from in the
27162722 file. If ` position` is ` null ` or ` - 1 ` , data will be read from the current
27172723 file position, and the file position will be updated. If ` position` is an
@@ -2748,7 +2754,7 @@ changes:
27482754* ` options` {Object}
27492755 * ` buffer` {Buffer|TypedArray|DataView} **Default:** ` Buffer .alloc (16384 )`
27502756 * ` offset` {integer} **Default:** ` 0 `
2751- * ` length` {integer} **Default:** ` buffer .length `
2757+ * ` length` {integer} **Default:** ` buffer .byteLength `
27522758 * ` position` {integer|bigint} **Default:** ` null `
27532759* ` callback` {Function}
27542760 * ` err` {Error}
@@ -4657,7 +4663,7 @@ changes:
46574663* ` buffer` {Buffer|TypedArray|DataView}
46584664* ` options` {Object}
46594665 * ` offset` {integer} **Default:** ` 0 `
4660- * ` length` {integer} **Default:** ` buffer .length `
4666+ * ` length` {integer} **Default:** ` buffer .byteLength `
46614667 * ` position` {integer|bigint} **Default:** ` null `
46624668* Returns: {number}
46634669
0 commit comments