Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/random-access-storage/abstract-random-access
Base class for random access stores
https://github.com/random-access-storage/abstract-random-access
Last synced: 3 months ago
JSON representation
Base class for random access stores
- Host: GitHub
- URL: https://github.com/random-access-storage/abstract-random-access
- Owner: random-access-storage
- Archived: true
- Created: 2016-07-27T09:28:02.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-05T11:59:55.000Z (almost 7 years ago)
- Last Synced: 2024-05-16T13:17:56.964Z (9 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 29
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-dat - abstract-random-access - base class for random access stores (Dat Core Modules / Storage)
README
# DEPRECATED
Use [random-access-storage](https://github.com/random-access-storage/random-access-storage) instead.
# abstract-random-access
Base class for random access stores, such as
- [random-access-file](https://github.com/mafintosh/random-access-file)
- [random-access-memory](https://github.com/mafintosh/random-access-memory)## Features
- ensures the store has been `.open()`ed
- verifies and defaults arguments
- provides stubs for unimplemented functions
- emits `open` and `close` events## Example
```js
var Abstract = require('abstract-random-access')
var inherits = require('inherits')var Store = function () {
Abstract.call(this)
}inherits(Store, Abstract)
Store.prototype._read = function (offset, length, callback) {
process.nextTick(function () {
callback(null, Buffer('ohai'))
})
}
```## License
MIT