Feed store for dapi-db


1.4.23 years ago3 years agoMinified + gzip package size for @dashevo/dapi-db-feedstore in KB



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


npm install orbit-db ipfs


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


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


See orbit-db's contributing guideline.


MIT © 2016-2018 Protocol Labs Inc., Haja Networks Oy, 2018 Dash Core Group, Inc.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.