# orbit-db-eventstore

> Eventlog for orbit-db

Latest version **2.0.0** (published 2023-01-18) · MIT license · 3.4K weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install orbit-db-eventstore
pnpm add orbit-db-eventstore
yarn add orbit-db-eventstore
bun add orbit-db-eventstore
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-01-18 |
| First published | 2016-05-07 |
| Weekly downloads | 3.4K |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Author | Haad |
| Maintainers | haad, shamb0t, hajamark |
| Keywords | orbitdb, orbit-db, eventstore |

## Links

- npm: https://www.npmjs.com/package/orbit-db-eventstore
- Repository: https://github.com/orbitdb/orbit-db-eventstore
- Issues: https://github.com/orbitdb/orbit-db-eventstore/issues
- npm.io page: https://npm.io/package/orbit-db-eventstore

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2023-01-18
- 2.0.1-cb7f06c.0 (next) — 2023-01-18
- 1.11.1-6419a8d.0 — 2023-01-11
- 1.12.0 — 2020-09-16
- 1.11.0 — 2020-09-11
- 1.10.0 — 2020-09-06
- 1.9.0 — 2020-05-12
- 1.8.0 — 2020-03-07
- 1.7.0 — 2019-12-05
- 1.6.0 — 2019-10-03
- 1.6.0-rc1 — 2019-08-30
- 1.5.1 — 2019-05-06
- 1.4.1 — 2019-05-06
- 1.5.0 — 2019-05-03
- 1.5.0-rc3 — 2019-04-29
- … 41 more at https://npm.io/package/orbit-db-eventstore/versions

## README

# orbit-db-eventstore

[![npm version](https://badge.fury.io/js/orbit-db-eventstore.svg)](https://badge.fury.io/js/orbit-db-eventstore)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/orbitdb/Lobby) [![Matrix](https://img.shields.io/badge/matrix-%23orbitdb%3Apermaweb.io-blue.svg)](https://riot.permaweb.io/#/room/#orbitdb:permaweb.io) 

> Append-Only Log database for orbit-db

An append-only log with traversable history. Useful for *"latest N"* use cases or as a message queue.

Used in [orbit-db](https://github.com/haadcode/orbit-db).

## Table of Contents

- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [Contributing](#contributing)
- [License](#license)

## Install

This project uses [npm](https://npmjs.com) and [nodejs](https://nodejs.org)

```sh
npm install orbit-db ipfs
```

## Usage

First, create an instance of OrbitDB:

```javascript
import * as IPFS from 'ipfs'
import OrbitDB from 'orbit-db'

const ipfs = new IPFS()
const orbitdb = await OrbitDB.createInstance(ipfs)
```

Get a log database and add an entry to it:

```javascript
const log = await orbitdb.eventlog('haad.posts')
log.add({ name: 'hello world' })
  .then(() => {
    const items = log.iterator().collect().map(e => e.payload.value)
    items.forEach(e => console.log(e.name))
    // "hello world"
  })
```

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

```javascript
const log = await orbitdb.eventlog('haad.posts')
log.events.on('ready', () => {
  const items = log.iterator().collect().map(e => e.payload.value)
  items.forEach(e => console.log(e.name))
  // "hello world"
})
```

See [example/index.html](https://github.com/haadcode/orbit-db-eventstore/blob/master/example/index.html) for a detailed example. Note that to run this example, you need to have a local [IPFS daemon](https://dist.ipfs.io/go-ipfs/floodsub-2) [running](https://ipfs.io/docs/getting-started/) at port 5001.

## API

See [orbit-db's API Documenations](https://github.com/haadcode/orbit-db/blob/master/API.md#eventlogname) for full details.

## Contributing

If you think this could be better, please [open an issue](https://github.com/orbitdb/orbit-db-eventstore/issues/new)!

Please note that all interactions in @orbitdb fall under our [Code of Conduct](CODE_OF_CONDUCT.md).

Note that tests for this module are in the [`orbit-db`](https://github.com/orbitdb/orbit-db) repository.

## License

[MIT](LICENSE) © 2016-2020 Protocol Labs Inc., Haja Networks Oy

---
_Source: https://npm.io/package/orbit-db-eventstore · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
