diff --git a/doc/api/fs.md b/doc/api/fs.md index 80bbe9eb9806dd..d47e6ef5c2c179 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -561,7 +561,7 @@ added: v10.0.0 Change the file system timestamps of the object referenced by the {FileHandle} then resolves the promise with no arguments upon success. -#### `filehandle.write(buffer[, offset[, length[, position]]])` +#### `filehandle.write(buffer, offset[, length[, position]])` + +* `buffer` {Buffer|TypedArray|DataView} +* `options` {Object} + * `offset` {integer} **Default:** `0` + * `length` {integer} **Default:** `buffer.byteLength - offset` + * `position` {integer} **Default:** `null` +* Returns: {Promise} + +Write `buffer` to the file. + +Similar to the above `filehandle.write` function, this version takes an +optional `options` object. If no `options` object is specified, it will +default with the above values. + #### `filehandle.write(string[, position[, encoding]])` + +* `fd` {integer} +* `buffer` {Buffer|TypedArray|DataView} +* `options` {Object} + * `offset` {integer} **Default:** `0` + * `length` {integer} **Default:** `buffer.byteLength - offset` + * `position` {integer} **Default:** `null` +* `callback` {Function} + * `err` {Error} + * `bytesWritten` {integer} + * `buffer` {Buffer|TypedArray|DataView} + +Write `buffer` to the file specified by `fd`. + +Similar to the above `fs.write` function, this version takes an +optional `options` object. If no `options` object is specified, it will +default with the above values. + ### `fs.write(fd, string[, position[, encoding]], callback)` + +* `fd` {integer} +* `buffer` {Buffer|TypedArray|DataView} +* `options` {Object} + * `offset` {integer} **Default:** `0` + * `length` {integer} **Default:** `buffer.byteLength - offset` + * `position` {integer} **Default:** `null` +* Returns: {number} The number of bytes written. + +For detailed information, see the documentation of the asynchronous version of +this API: [`fs.write(fd, buffer...)`][]. + ### `fs.writeSync(fd, string[, position[, encoding]])`