# ipfs-pubsub-1on1

> 1-to-1 communication channel over IPFS Pubsub between two peers

Latest version **0.1.0** (published 2023-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install ipfs-pubsub-1on1
pnpm add ipfs-pubsub-1on1
yarn add ipfs-pubsub-1on1
bun add ipfs-pubsub-1on1
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-01-19 |
| First published | 2018-03-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Haad |
| Maintainers | haad, shamb0t, hajamark |

## Links

- npm: https://www.npmjs.com/package/ipfs-pubsub-1on1
- npm.io page: https://npm.io/package/ipfs-pubsub-1on1

## Dependencies (1)

- [safe-buffer](https://npm.io/package/safe-buffer.md) ~5.2.1

## Recent versions

- 0.1.0 (latest) — 2023-01-19
- 0.1.1-4e113e9.0 (next) — 2023-01-19
- 0.1.1-a0dab52.0 — 2023-01-19
- 0.0.8-5e2b754.0 — 2023-01-19
- 0.0.8-360b964.0 — 2023-01-11
- 0.0.8 — 2022-01-20
- 0.0.7 — 2020-09-16
- 0.0.6 — 2019-04-29
- 0.0.5 — 2019-04-29
- 0.0.4 — 2018-04-14
- 0.0.3 — 2018-03-31
- 0.0.2 — 2018-03-06

## README

# ipfs-pubsub-1on1

> Communication channel between two peers over IPFS Pubsub

**_Work in progress!_**

`ipfs-pubsub-1on1` is a 1-to-1 communication channel over IPFS Pubsub. It enables two peers to exchange messages between each other. Note that the channel is currently not authenticated nor encrypted!

## Usage

```javascript
// Include as lib
import Channel from 'ipfs-pubsub-1on1'
// Create IPFS instance somehow
const ipfs = new IPFS()
// IPFS peer ID of the peer to connect to
const friendId = 'QmP9TWCAsHLs6a3hcCbqE6WZs3VhQF6QsmkFPAFmmcuMa6'
// Open a channel with the other peer
const channel = await Channel.open(ipfs, friendId)
// Explicitly wait for peers to connect
await channel.connect()
// Send message on the channel
await channel.send('Hello World!')
// Process messages from the other peer
channel.on('message', (message) => {
  console.log('Message from', message.from, message)
})
```

For more usage examples, see the [tests](https://github.com/haadcode/ipfs-pubsub-dc/blob/master/test/direct-channel.test.js)

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