From 8e080c14cf25765021bab68d332549d7166d107e 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 21bb160313cb09..4ac95d58e20230 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3209,6 +3209,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])`