This repository has been archived by the owner. It is now read-only.
Base class for random access stores
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore init this Jul 27, 2016
README.md Update README.md Feb 5, 2018
index.js fix .end(cb) never calling cb Oct 7, 2016
package.json upgrade standard Jun 5, 2017
test.js upgrade standard Jun 5, 2017

README.md

DEPRECATED

Use random-access-storage instead.

abstract-random-access

Base class for random access stores, such as

Features

  • ensures the store has been .open()ed
  • verifies and defaults arguments
  • provides stubs for unimplemented functions
  • emits open and close events

Example

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