# callbag-from-events

> Create a Callbag from any object with on/off methods, a DOM EventTarget, or a Node.JS EventEmitter.

Latest version **1.1.0** (published 2018-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install callbag-from-events
pnpm add callbag-from-events
yarn add callbag-from-events
bun add callbag-from-events
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2018-10-14 |
| First published | 2018-07-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Sartaj |
| Maintainers | sartaj |
| Keywords | Callbag, Callbags |

## Links

- npm: https://www.npmjs.com/package/callbag-from-events
- Repository: https://github.com/sartaj/callbag-from-events
- Homepage: https://github.com/sartaj/callbag-from-events#readme
- Issues: https://github.com/sartaj/callbag-from-events/issues
- npm.io page: https://npm.io/package/callbag-from-events

## Dependencies (1)

- [callbag](https://npm.io/package/callbag.md) 1.1.0

## Recent versions

- 1.1.0 (latest) — 2018-10-14
- 1.0.6 — 2018-07-25
- 1.0.5 — 2018-07-25
- 1.0.4 — 2018-07-25
- 1.0.3 — 2018-07-25
- 1.0.1 — 2018-07-25
- 1.0.0 — 2018-07-25

## README

# callbag-from-events

Create a Callbag from:

- any object with on/off methods,
- a DOM EventTarget,
- or a Node.JS EventEmitter.

```javascript
import fromEvents from 'callbag-from-events'
import { map, filter } from 'callbag-basics'
import { ipcMain } from 'electron'
import { nodeEvents } from './server'

const chatReceived = fromEvents(nodeEvents, 'chat-received')
  |> filter(message => message.length > 0)
  |> map(message => ({ chat: message }))

const buttonClicked = fromEvents(document.getElementById('start'), 'click')

const processCompleted = fromEvents(ipcMain, 'process-completed')
```

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