Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

abstract-stream-leveldown

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstract-stream-leveldown

A stream-based abstract prototype matching the LevelDOWN API

  • 1.1.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
2
Weekly downloads
 
Created
Source

abstract-stream-leveldown

This library provides a smaller API footprint for using AbstractLevelDOWN to create a LevelDOWN backend, by implementing a Readable and Writable stream instead of all of the abstract LevelDOWN methods. It's a good fit for turning something that already has readable and writable stream interfaces into a LevelDOWN backend.

Example

in es6

import {AbstractStreamLevelDOWN} from "abstract-stream-leveldown"

class MyLevelDOWN extends AbstractStreamLevelDOWN {
   _createReadStream([options]) { /* return a Readable */ }
   _createWriteStream([options]) { /* return a Writable */ }
}

in es5

var inherits = require('inherits')
var assign = require('object-assign')
var AbstractStreamLevelDOWN = require('abstract-stream-leveldown').AbstractStreamLevelDOWN

function MyLevelDOWN (location) {
  AbstractLevelDOWN.call(this, location)
}
inherits(MyLevelDOWN, AbstractStreamLevelDOWN)
assign(AbstractStreamLevelDOWN, {
  _createReadStream([options]) { /* return a Readable */ }
  _createWriteStream([options]) { /* return a Writable */ }
}

API

AbstractStreamLevelDOWN#_createReadStream([options])

Returns a Readable stream. options should support the same properties as those to be passed to createReadStream.

AbstractStreamLevelDOWN#_createWriteStream([options])

Returns a Writable stream. options should support the same properties as those to be passed to put. This stream accepts {key, value} objects, and will perform a del if the value is null or undefined, and a put otherwise.

Keywords

FAQs

Package last updated on 11 Sep 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc