JSPM

abstract-random-access

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 186
  • Score
    100M100P100Q90317F
  • License MIT

Base class for random access stores

Package Exports

  • abstract-random-access

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (abstract-random-access) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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