dev-zero-storage
v1.0.0
Published
Exposes the same interface as random-access-file but instead of writing/reading data to a file it will always return a zero'ed out buffer when reading (similar to reading from /dev/zero)
Downloads
4
Readme
dev-zero-storage
Exposes the same interface as random-access-file but instead of writing/reading data to a file it will always return a zero'ed out buffer when reading (similar to reading from /dev/zero).
npm install dev-zero-storage
Usage
var storage = require('dev-zero-storage')
var zero = storage()
zero.read(0, 10, function (err, buf) {
console.log(buf) // 10 0-bytes
})
zero.read(0, 1000, function (err, buf) {
console.log(buf) // 1000 0-bytes
})
License
MIT