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

orbit-db-eventstore

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orbit-db-eventstore

Eventlog for orbit-db

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
278
decreased by-44.18%
Maintainers
1
Weekly downloads
 
Created
Source

orbit-db-eventstore

Eventlog for orbit-db

Requirements

  • Node.js v6.0 or later

Install

npm install orbit-db-eventstore

Usage

const ipfs = require('ipfs')
const EventStore = require('orbit-db-eventstore')
const store = new EventStore(ipfs, 'user id', 'database name')

// Sync store with another store
// hash is the IPFS hash of otherStore.snapshot
store.sync(hash)

// Add an event
const hash = store.add({ data: 'hello friend' })

// Get a single event
store.get(hash)

// Get an iterator
const iter = store.iterator({ limit: 20, lt: hash }) // iterator
const items = iter.collect() // convert to an Array
/*
  Where `options` is:
  {
    limit: 100, // number of items to return
    gt: <hash>, // get events newer than <hash>
    lt: <hash>, // get events older than <hash>
    gte: <hash>, // get event newer than <hash> including <hash>
    lte: <hash>, // get event older than <hash> including <hash>
  }
*/

API

TODO

FAQs

Package last updated on 03 Oct 2016

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