# eosio-history-demux

> EOSIO History Demux

Latest version **0.1.1** (published 2019-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install eosio-history-demux
pnpm add eosio-history-demux
yarn add eosio-history-demux
bun add eosio-history-demux
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-09-25 |
| First published | 2019-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 3 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Igor Berlenko |
| Maintainers | sevenflash |

## Links

- npm: https://www.npmjs.com/package/eosio-history-demux
- Repository: https://github.com/7flash/eosio-history-demux
- Homepage: https://github.com/7flash/eosio-history-demux#readme
- Issues: https://github.com/7flash/eosio-history-demux/issues
- npm.io page: https://npm.io/package/eosio-history-demux

## Dependencies (3)

- [eosjs](https://npm.io/package/eosjs.md) ^20.0.0
- [highland](https://npm.io/package/highland.md) ^2.13.5
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0

## Recent versions

- 0.1.1 (latest) — 2019-09-25
- 0.1.0 — 2019-09-20
- 0.0.1 — 2019-08-19

## README

[![Build Status](https://travis-ci.org/7flash/eosio-history-demux.svg?branch=master)](https://travis-ci.org/7flash/eosio-history-demux)
[![Coverage Status](https://coveralls.io/repos/github/7flash/eosio-history-demux/badge.svg?branch=master)](https://coveralls.io/github/7flash/eosio-history-demux?branch=master)
![npm (scoped)](https://img.shields.io/npm/v/eosio-history-demux)

# eosio-history-demux

> Demux is a backend infrastructure pattern for sourcing blockchain events to deterministically update queryable datastores and trigger side effects.
(https://github.com/EOSIO/demux-js)

This library provides efficient implementation of demux pattern using History API.

## Install

```
$ npm install eosio-history-demux
```

## Example

```
const { createClient, createReducer } = require('eosio-history-demux')

const httpEndpoint = 'https://api.eos.miami'

const client = createClient(httpEndpoint)

const reducer = createReducer({
    client,
    contractName: 'eosio.msig',
    fromAction: 0, // number of action in history (optional)
    batchSize: 64, // number of actions per request (optional)
    handlers: {
      // actions are processed sequentially, therefore handlers can depend on data indexed by previous handler
      'propose': async (transaction) => console.log(`new proposal at action #${transaction.account_action_seq}`),
      'approve': async (transaction) => console.log(`new approval at action #${transaction.account_action_seq}`)
    }
})
```

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