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

orbit-db-feedstore

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orbit-db-feedstore

Feed store for orbit-db

  • 1.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
308
decreased by-48.32%
Maintainers
1
Weekly downloads
 
Created
Source

orbit-db-feedstore

npm version

A log database with traversable history. Entries can be added and removed. Useful for "shopping cart" type of use cases, or for example as a feed of blog posts or "tweets".

Used in orbit-db.

Table of Contents

Install

npm install orbit-db ipfs

Usage

First, create an instance of OrbitDB:

const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')

const ipfs = new IPFS()
const orbitdb = new OrbitDB(ipfs)

Get a feed database and add an entry to it:

const feed = orbitdb.feed('haad.posts')
feed.add({ title: 'Hello', content: 'World' })
  .then(() => {
    const posts = feed.iterator().collect()
    posts.forEach((post) => {
      let data = post.payload.value
      console.log(data.title + '\n', data.content)
      // Hello 
      //  World   
    })
  })

Later, when the database contains data, load the history and query when ready:

const feed = orbitdb.feed('haad.posts')
feed.events.on('ready', () => {
  const posts = feed.iterator().collect()
  posts.forEach((post) => console.log(post.title + '\n', post.content))
  // Hello 
  // World  
})

API

See orbit-db's API Documenations for full details.

Contributing

See orbit-db's contributing guideline.

License

MIT ©️ 2016 Haadcode

FAQs

Package last updated on 31 Mar 2018

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