random-access-storage / abstract-random-access

Base class for random access stores

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Base class for random access stores


Languages

Language:JavaScript 100.0%