@@ -2764,6 +2764,29 @@ The callback is given the three arguments, `(err, bytesRead, buffer)`.
27642764If this method is invoked as its [ ` util.promisify() ` ] [ ] ed version, it returns
27652765a ` Promise ` for an ` Object ` with ` bytesRead ` and ` buffer ` properties.
27662766
2767+ ## ` fs.read(fd, [options,] callback) `
2768+ <!-- YAML
2769+ added: REPLACEME
2770+ changes:
2771+ - version: REPLACEME
2772+ pr-url: https://github.com/nodejs/node/pull/31402
2773+ description: Options object can be passed in
2774+ to make Buffer, offset, length and position optional
2775+ -->
2776+ * ` fd ` {integer}
2777+ * ` options ` {Object}
2778+ * ` buffer ` {Buffer|TypedArray|DataView} ** Default:** ` Buffer.alloc(16384) `
2779+ * ` offset ` {integer} ** Default:** ` 0 `
2780+ * ` length ` {integer} ** Default:** ` buffer.length `
2781+ * ` position ` {integer} ** Default:** ` null `
2782+ * ` callback ` {Function}
2783+ * ` err ` {Error}
2784+ * ` bytesRead ` {integer}
2785+ * ` buffer ` {Buffer}
2786+
2787+ Similar to the above ` fs.read ` function, this version takes an optional ` options ` object.
2788+ If no ` options ` object is specified, it will default with the above values.
2789+
27672790## ` fs.readdir(path[, options], callback) `
27682791<!-- YAML
27692792added: v0.1.8
@@ -4377,6 +4400,17 @@ Following successful read, the `Promise` is resolved with an object with a
43774400` bytesRead ` property specifying the number of bytes read, and a ` buffer `
43784401property that is a reference to the passed in ` buffer ` argument.
43794402
4403+ #### ` filehandle.read(options) `
4404+ <!-- YAML
4405+ added: REPLACEME
4406+ -->
4407+ * ` options ` {Object}
4408+ * ` buffer ` {Buffer|Uint8Array} ** Default:** ` Buffer.alloc(16384) `
4409+ * ` offset ` {integer} ** Default:** ` 0 `
4410+ * ` length ` {integer} ** Default:** ` buffer.length `
4411+ * ` position ` {integer} ** Default:** ` null `
4412+ * Returns: {Promise}
4413+
43804414#### ` filehandle.readFile(options) `
43814415<!-- YAML
43824416added: v10.0.0
0 commit comments