# kad

> extensible implementation of the kademlia dht

Latest version **2.5.1** (published 2018-01-23) · AGPL-3.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install kad
pnpm add kad
yarn add kad
bun add kad
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.5.1 |
| Published | 2018-01-23 |
| First published | 2015-04-14 |
| Weekly downloads | 0 |
| License | AGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.9.1 |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | Gordon Hall |
| Maintainers | bookchin |
| Keywords | dht, kademlia, p2p |

## Links

- npm: https://www.npmjs.com/package/kad
- Repository: https://github.com/kadtools/kad
- Homepage: https://github.com/kadtools/kad#readme
- Issues: https://github.com/kadtools/kad/issues
- npm.io page: https://npm.io/package/kad

## Dependencies (7)

- [uuid](https://npm.io/package/uuid.md) ^3.0.1
- [async](https://npm.io/package/async.md) ^2.1.4
- [merge](https://npm.io/package/merge.md) ^1.2.0
- [bunyan](https://npm.io/package/bunyan.md) ^1.8.5
- [metapipe](https://npm.io/package/metapipe.md) ^2.0.1
- [jsonrpc-lite](https://npm.io/package/jsonrpc-lite.md) ^1.2.3
- [concat-stream](https://npm.io/package/concat-stream.md) ^1.6.0

## Recent versions

- 2.5.1 (latest) — 2018-01-23
- 2.5.0 — 2017-12-26
- 2.4.1 — 2017-09-25
- 2.4.0 — 2017-08-10
- 2.3.3 — 2017-07-30
- 2.3.2 — 2017-06-24
- 2.3.1 — 2017-06-20
- 2.3.0 — 2017-05-30
- 2.2.1 — 2017-05-13
- 2.2.0 — 2017-04-20
- 2.1.0 — 2017-04-20
- 2.0.1 — 2017-04-19
- 2.0.0 — 2017-03-17
- 1.6.5 — 2017-03-14
- 1.6.4 — 2016-12-11
- … 67 more at https://npm.io/package/kad/versions

## README

![Kad](https://nodei.co/npm/kad.png?downloads=true)
===================================================================

[![Build Status](https://img.shields.io/travis/kadtools/kad/master.svg?style=flat-square)](https://travis-ci.org/kadtools/kad) | 
[![Coverage Status](https://img.shields.io/coveralls/kadtools/kad.svg?style=flat-square)](https://coveralls.io/r/kadtools/kad) | 
[![NPM](https://img.shields.io/npm/v/kad.svg?style=flat-square)](https://www.npmjs.com/package/kad)

Peer-to-peer application framework implementing the 
[Kademlia](http://www.scs.stanford.edu/~dm/home/papers/kpos.pdf) distributed
hash table for Node.js and the browser.

> Looking for documentation for Kad v1.6.x? 
> [Go here](https://kadtools.github.io/docs-v1.6.x/)!

Usage
-----

Install `kad` as a dependency of your package using NPM.

```
npm install kad --save
```

Choose a transport, storage layer, and your node's contact information.

```js
const kad = require('kad');

const node = kad({
  transport: new kad.HTTPTransport(),
  storage: require('levelup')('path/to/storage.db'),
  contact: { hostname: 'your.host.name', port: 8080 }
});

const seed = [
  'ea48d3f07a5241291ed0b4cab6483fa8b8fcc127',
  { hostname: 'seed.host.name', port: 8080 }
];

node.listen(1337);
node.join(seed, function() {
  console.log(`Connected to ${node.router.size} peers!`);
});
```

For complete documentation, tutorials, and examples on how to extend the
base protocol for building your own distributed networks, check out the 
[complete documentation](http://kadtools.github.io).

Resources
---------

* [Transports](http://kadtools.github.io/tutorial-transport-adapters.html)
* [Middleware](http://kadtools.github.io/tutorial-middleware.html)
* [Plugins](http://kadtools.github.io/tutorial-plugins.html)
* [Storage](http://kadtools.github.io/tutorial-storage-adapters.html)
* [Identities](http://kadtools.github.io/tutorial-identities.html)
* [Messages](http://kadtools.github.io/tutorial-messengers.html)

License
-------

Kad - Peer-to-peer application framework implementing Kademlia DHT  
Copyright (C) 2017 Gordon Hall

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.

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