# peer-wire-swarm

> a peer swarm implementation

Latest version **0.12.2** (published 2018-03-23) · 0 weekly downloads

## Install

```sh
npm install peer-wire-swarm
pnpm add peer-wire-swarm
yarn add peer-wire-swarm
bun add peer-wire-swarm
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.12.2 |
| Published | 2018-03-23 |
| First published | 2013-04-16 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 80 |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/peer-wire-swarm
- Repository: https://github.com/mafintosh/peer-wire-swarm
- Homepage: https://github.com/mafintosh/peer-wire-swarm#readme
- Issues: https://github.com/mafintosh/peer-wire-swarm/issues
- npm.io page: https://npm.io/package/peer-wire-swarm

## Dependencies (6)

- [utp](https://npm.io/package/utp.md) 0.0.7
- [fifo](https://npm.io/package/fifo.md) ^0.1.4
- [once](https://npm.io/package/once.md) ^1.1.1
- [buffer-from](https://npm.io/package/buffer-from.md) ^1.0.0
- [speedometer](https://npm.io/package/speedometer.md) ^0.1.2
- [peer-wire-protocol](https://npm.io/package/peer-wire-protocol.md) ^0.7.0

## Recent versions

- 0.12.2 (latest) — 2018-03-23
- 0.12.1 — 2015-07-27
- 0.12.0 — 2015-05-07
- 0.11.0 — 2015-05-07
- 0.10.0 — 2014-12-02
- 0.9.2 — 2014-09-14
- 0.9.1 — 2014-05-18
- 0.9.0 — 2014-04-25
- 0.8.0 — 2014-04-14
- 0.7.2 — 2014-03-22
- 0.7.1 — 2014-03-20
- 0.7.0 — 2014-03-16
- 0.6.1 — 2014-03-14
- 0.6.0 — 2014-03-11
- 0.5.2 — 2014-03-09
- … 12 more at https://npm.io/package/peer-wire-swarm/versions

## README

# peer-wire-swarm

Swarm implementation for Bittorrent

	npm install peer-wire-swarm

# Usage

``` js
var wireSwarm = require('peer-wire-swarm');
var swarm = wireSwarm(myInfoHash, myPeerId);

swarm.on('wire', function(wire) {
	// a relevant peer-wire-protocol as appeared
	// see the peer-wire-protocol module for more info

	wire.on('unchoke', function() {
		// we are now unchoked
	});

	swarm.wires // <- list of all connected wires
});

swarm.add('127.0.0.1:42442'); // add a peer
swarm.remove('127.0.0.1:42244'); // remove a peer

swarm.pause();  // pause the swarm (stops adding connections)
swarm.resume(); // resume the swarms

swarm.listen(6881); // listen for incoming connections (optional)
```

## License

MIT

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