How to use the readv function from graceful-fs

Find comprehensive JavaScript graceful-fs.readv code examples handpicked from public code repositorys.

99
100
101
102
103
104
105
106
107
108
// Function signature is
// s.readv(fd, buffers[, position], callback)
// We need to handle the optional arg, so we use ...args
exports.readv = function (fd, buffers, ...args) {
  if (typeof args[args.length - 1] === 'function') {
    return fs.readv(fd, buffers, ...args)
  }

  return new Promise((resolve, reject) => {
    fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {
fork icon808
star icon0
watch icon93

+ 27 other calls in file