@@ -2775,6 +2775,29 @@ The callback is given the three arguments, `(err, bytesRead, buffer)`.
27752775If this method is invoked as its [ ` util.promisify() ` ] [ ] ed version, it returns
27762776a ` Promise ` for an ` Object ` with ` bytesRead ` and ` buffer ` properties.
27772777
2778+ ## ` fs.read(fd, [options,] callback) `
2779+ <!-- YAML
2780+ added: REPLACEME
2781+ changes:
2782+ - version: REPLACEME
2783+ pr-url: https://github.com/nodejs/node/pull/31402
2784+ description: Options object can be passed in
2785+ to make Buffer, offset, length and position optional
2786+ -->
2787+ * ` fd ` {integer}
2788+ * ` options ` {Object}
2789+ * ` buffer ` {Buffer|TypedArray|DataView} ** Default:** ` Buffer.alloc(16384) `
2790+ * ` offset ` {integer} ** Default:** ` 0 `
2791+ * ` length ` {integer} ** Default:** ` buffer.length `
2792+ * ` position ` {integer} ** Default:** ` null `
2793+ * ` callback ` {Function}
2794+ * ` err ` {Error}
2795+ * ` bytesRead ` {integer}
2796+ * ` buffer ` {Buffer}
2797+
2798+ Similar to the above ` fs.read ` function, this version takes an optional ` options ` object.
2799+ If no ` options ` object is specified, it will default with the above values.
2800+
27782801## ` fs.readdir(path[, options], callback) `
27792802<!-- YAML
27802803added: v0.1.8
@@ -4362,6 +4385,17 @@ Following successful read, the `Promise` is resolved with an object with a
43624385` bytesRead ` property specifying the number of bytes read, and a ` buffer `
43634386property that is a reference to the passed in ` buffer ` argument.
43644387
4388+ #### ` filehandle.read(options) `
4389+ <!-- YAML
4390+ added: REPLACEME
4391+ -->
4392+ * ` options ` {Object}
4393+ * ` buffer ` {Buffer|Uint8Array} ** Default:** ` Buffer.alloc(16384) `
4394+ * ` offset ` {integer} ** Default:** ` 0 `
4395+ * ` length ` {integer} ** Default:** ` buffer.length `
4396+ * ` position ` {integer} ** Default:** ` null `
4397+ * Returns: {Promise}
4398+
43654399#### ` filehandle.readFile(options) `
43664400<!-- YAML
43674401added: v10.0.0
0 commit comments