# atom-pubsub

> mini pubsub

Latest version **1.0.6** (published 2022-02-07) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2022-02-07 |
| First published | 2021-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | atomzamonday |
| Maintainers | atomzamonday |

## Links

- npm: https://www.npmjs.com/package/atom-pubsub
- Repository: https://github.com/atomzamonday/Atom-PubSub
- npm.io page: https://npm.io/package/atom-pubsub

## Dependencies (1)

- [nanoid](https://npm.io/package/nanoid.md) ^3.1.30

## Recent versions

- 1.0.6 (latest) — 2022-02-07
- 1.0.5 — 2022-02-04
- 1.0.4 — 2021-11-30
- 1.0.3 — 2021-11-28
- 1.0.2 — 2021-11-16
- 1.0.1 — 2021-11-16
- 1.0.0 — 2021-11-16

## README

```ts
const pubsub = require("atom-pubsub").pubsub;
// Or ES
import { pubsub } from "atom-pubsub";

const id1 = pubsub.subscribe("hello-world", (data) => {
  console.log(`hello ${data} from A`);
});
const id2 = pubsub.subscribe("hello-world", (data) => {
  console.log(`hello ${data} from B`);
});
pubsub.publish("hello-world", "Tomson");
pubsub.unsubscribe(id1);
pubsub.publish("hello-world", "James");
pubsub.unsubscribe(id2);
```

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