diff --git a/doc/api/fs.md b/doc/api/fs.md index 304c308d46d45c..480685d3785fd9 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -646,6 +646,25 @@ On Linux, positional writes do not work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file. +#### `filehandle.write(buffer, options)` + + + +* `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` +* 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]])`