# @arcblock/event-hub

> A nodejs module for local and remote Inter Process Event

Latest version **1.30.24** (published 2026-05-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @arcblock/event-hub
pnpm add @arcblock/event-hub
yarn add @arcblock/event-hub
bun add @arcblock/event-hub
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.30.24 |
| Published | 2026-05-14 |
| First published | 2021-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 40.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | arcblock |
| Maintainers | wangshijun, polunzh, mave99a, gxw |

## Links

- npm: https://www.npmjs.com/package/@arcblock/event-hub
- npm.io page: https://npm.io/package/@arcblock/event-hub

## Dependencies (5)

- [axon](https://npm.io/package/axon.md) ^2.0.3
- [amp-message](https://npm.io/package/amp-message.md) ~0.1.2
- [@ocap/wallet](https://npm.io/package/@ocap/wallet.md) 1.30.24
- [@arcblock/did](https://npm.io/package/@arcblock/did.md) 1.30.24
- [@arcblock/jwt](https://npm.io/package/@arcblock/jwt.md) 1.30.24

## Recent versions

- 1.30.24 (latest) — 2026-05-14
- 1.30.23 — 2026-05-13
- 1.30.22 — 2026-05-13
- 1.30.21 — 2026-05-12
- 1.30.20 — 2026-05-12
- 1.30.19 — 2026-05-12
- 1.30.18 — 2026-05-11
- 1.30.17 — 2026-05-11
- 1.30.16 — 2026-05-10
- 1.30.15 — 2026-05-08
- 1.30.14 — 2026-05-08
- 1.30.13 — 2026-05-08
- 1.30.12 — 2026-05-05
- 1.30.11 — 2026-05-03
- 1.30.10 — 2026-04-22
- … 425 more at https://npm.io/package/@arcblock/event-hub/versions

## README

# Event Hub

A module for local and remote Inter Process Event

![image](./docs/event-hub.svg)

## Usage

Install

```shell
bun install @arcblock/event-hub
```

Server

```javascript
process.env.ABT_NODE_EVENT_PORT=8888;

require('@arcblock/event-hub/lib/server.js);
```

Client

```javascript
// process 1

const Client = require('@arcblock/event-hub/lib/client');

const port = ''; // event-hub server port
const did = ''; // your did
const sk = ''; // your sk

const client = new Client({ port, did, sk, autoConnect: true });

const data = { foo: bar };

client.broadcast('my-event', data);
```

```javascript
// process 2

const Client = require('@arcblock/event-hub/lib/client');

const port = ''; // event-hub server port
const did = ''; // your did
const sk = ''; // your sk

const client = new Client({ port, did, sk, autoConnect: true });

client.on('my-event', (data) => {
  // handle data
});
```

---
_Source: https://npm.io/package/@arcblock/event-hub · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
