From b280c8621376c5ee0ea2228484c6e3f5be600c8b Mon Sep 17 00:00:00 2001 From: Lucas Holmquist Date: Wed, 27 May 2020 12:55:15 -0400 Subject: [PATCH] fs: support util.promisify for fs.readv PR-URL: https://github.com/nodejs/node/pull/33590 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater Reviewed-By: Benjamin Gruenbaum Reviewed-By: Robert Nagy Reviewed-By: Zeyu Yang Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- doc/api/fs.md | 3 +++ lib/fs.js | 3 +++ test/parallel/test-fs-readv-promisify.js | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 test/parallel/test-fs-readv-promisify.js diff --git a/doc/api/fs.md b/doc/api/fs.md index ce89126e82fcb4..46df36cf29e095 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3191,6 +3191,9 @@ from the current position. The callback will be given three arguments: `err`, `bytesRead`, and `buffers`. `bytesRead` is how many bytes were read from the file. +If this method is invoked as its [`util.promisify()`][]ed version, it returns +a `Promise` for an `Object` with `bytesRead` and `buffers` properties. + ## `fs.readvSync(fd, buffers[, position])`