https://github.com/jwerle/random-access-null
random-access-storage compliant null writer like a write to /dev/null
https://github.com/jwerle/random-access-null
random-access
Last synced: 10 months ago
JSON representation
random-access-storage compliant null writer like a write to /dev/null
- Host: GitHub
- URL: https://github.com/jwerle/random-access-null
- Owner: jwerle
- License: mit
- Created: 2018-03-13T13:05:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-13T13:13:44.000Z (almost 8 years ago)
- Last Synced: 2025-02-17T01:34:09.113Z (11 months ago)
- Topics: random-access
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
random-access-null
==================
[random-access-storage][random-access-storage] compliant null writer like a
write to `/dev/null`. All writes are discarded, all reads return a zero
buffer, and all stats return a stat with `size` set to `0`.
## Install
```sh
npm install random-access-null
```
## Usage
```js
var createRandomAccessNull = require('random-access-null')
var storage = createRandomAccessNull()
// empty reads
storage.read(0, 32, function (err, buf) {
console.log(err, buf) // null
})
// discarded writes
storage.write(32, Buffer.from('hello', function (err) {
console.log(err) // null
})
```
## License
MIT
[random-access-storage]: https://github.com/random-access-storage/random-access-storage