# easy-p2p

> Simple and easy use of p2p from [npm~peerjs](https://www.npmjs.com/package/peerjs)

Latest version **0.3.3** (published 2017-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install easy-p2p
pnpm add easy-p2p
yarn add easy-p2p
bun add easy-p2p
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2017-11-29 |
| First published | 2017-11-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | NPM easy-p2p |
| Maintainers | heyderpd |
| Keywords | peer, p2p, easy, simple |

## Links

- npm: https://www.npmjs.com/package/easy-p2p
- Repository: https://github.com/heyderpd/npm-easy-p2p
- Homepage: https://github.com/heyderpd/npm-easy-p2p#readme
- Issues: https://github.com/heyderpd/npm-easy-p2p/issues
- npm.io page: https://npm.io/package/easy-p2p

## Dependencies (2)

- [peerjs](https://npm.io/package/peerjs.md) ^0.3.14
- [randomstring](https://npm.io/package/randomstring.md) ^1.1.5

## Recent versions

- 0.3.3 (latest) — 2017-11-29
- 0.3.2 — 2017-11-29
- 0.3.1 — 2017-11-28
- 0.3.0 — 2017-11-28
- 0.2.8 — 2017-11-28
- 0.2.6 — 2017-11-14
- 0.2.5 — 2017-11-14

## README

# EASY P2P 
Simple and easy use of p2p from [npm~peerjs](https://www.npmjs.com/package/peerjs)

To create a key access [peerjs.com](http://peerjs.com/peerserver)

Example of Mult Mask:
```javascript
import peerConnection from 'easy-p2p'

const peer = new peerConnection('your-peerjs-developer-key')
```

Host:
```javascript
const onReceiveData = msg => console.log('msg:', msg)

conn
  .host()
  .setOnData(onReceiveData)

const peerId = conn.getId()

conn.send('server: test-msg')
```

Join:
```javascript
conn
  .join(peerId)
  .setOnData(onReceiveData)
  .send('client: test-msg')
```

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