Socket
Socket
Sign inDemoInstall

abstract-random-access

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    abstract-random-access

Base class for random access stores


Version published
Weekly downloads
91
decreased by-24.79%
Maintainers
1
Install size
12.5 kB
Created
Weekly downloads
 

Readme

Source

abstract-random-access

Base class for random access stores, such as

  • random-access-file
  • 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

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

FAQs

Last updated on 07 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc