1.0.0 • Published 7 years ago
fs-read-exactly v1.0.0
fs-read-exactly
Read exactly n bytes of an fd or file
example
const readExactly = require('fs-read-exactly')
readExactly('readme.md', 0, 15, function (err, chunk) {
console.log(err) // null
console.log(chunk.toString()) // '# fs-read-exact'
})
readExactly('readme.md', 0, 1e4, function (err, chunk) {
console.log(err.code) // 'EOF'
})
readExactly(mixed, pos, length, callback)
Where mixed
is either a filename or a file descriptor.
install
With npm do:
npm install fs-read-exactly
license
MIT © Vincent Weevers
1.0.0
7 years ago