# nano-pubsub

> Zero dependency, tiny (

Latest version **3.0.0** (published 2024-04-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install nano-pubsub
pnpm add nano-pubsub
yarn add nano-pubsub
bun add nano-pubsub
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2024-04-05 |
| First published | 2016-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Bjørge Næss |
| Maintainers | bjoerge |
| Keywords | pubsub, events, publish, subscribe |

## Links

- npm: https://www.npmjs.com/package/nano-pubsub
- Repository: https://github.com/bjoerge/nano-pubsub
- Homepage: https://github.com/bjoerge/nano-pubsub#readme
- Issues: https://github.com/bjoerge/nano-pubsub/issues
- npm.io page: https://npm.io/package/nano-pubsub

## 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

- 3.0.0 (latest) — 2024-04-05
- 2.0.1 — 2021-10-26
- 2.0.0 — 2020-09-21
- 1.0.2 — 2017-05-09
- 1.0.1 — 2016-09-23
- 1.0.0 — 2016-09-23

## README

# `nano-pubsub`

Tiny (<0.5 kb) publish/subscribe

## Install
```
npm install nano-pubsub
```

## Usage example
```js
import createPubsub from 'nano-pubsub'

const events = createPubsub()

const unsubscribe = events.subscribe(value => {
  console.log('got value:', value)
})

events.publish('Hello')
// => 'got value: Hello'

events.publish('World')
// => 'got value: World'

unsubscribe()

events.publish('Something')

// ...nothing
```

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