How to use the read function from fs-extra
Find comprehensive JavaScript fs-extra.read code examples handpicked from public code repositorys.
GitHub: hzcool/nflsoj
1294 1295 1296 1297 1298 1299 1300 1301 1302 1303
resolve(null) return } const contentLength = 128 var buffer = Buffer.alloc(contentLength) fs.read(fd, buffer, 0, contentLength, 0, function(err, num) { if(err) { resolve(null) } else { let data = buffer.toString('utf-8', 0, num) + (num >= contentLength ? "..." : "")
1
1
1
+ 6 other calls in file
7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868
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)
0
1
0
+ 26 other calls in file
fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)