How to use the read function from graceful-fs
Find comprehensive JavaScript graceful-fs.read code examples handpicked from public code repositorys.
69 70 71 72 73 74 75 76 77 78
exports.read = function (fd, buffer, offset, length, position, callback) { if (typeof callback === 'function') { return fs.read(fd, buffer, offset, length, position, callback) } return new Promise((resolve, reject) => { fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { if (err) return reject(err) resolve({ bytesRead, buffer }) }) })
808
0
93
+ 41 other calls in file
70 71 72 73 74 75 76 77 78 79
return new Promise(resolve => { return fs.exists(filename, resolve) }) } // fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args exports.read = function (fd, buffer, offset, length, position, callback) { if (typeof callback === 'function') { return fs.read(fd, buffer, offset, length, position, callback)
806
0
1
+ 29 other calls in file
GitHub: lioxryt/lioxryt-assets
68 69 70 71 72 73 74 75 76 77 78 79
return new Promise(resolve => { return fs.exists(filename, resolve) }) } // fs.read() & fs.write need special treatment due to multiple callback args exports.read = function (fd, buffer, offset, length, position, callback) { if (typeof callback === 'function') { return fs.read(fd, buffer, offset, length, position, callback)
8
3
0
+ 2 other calls in file
graceful-fs.promises is the most popular function in graceful-fs (1135 examples)