# js-libp2p-kad-dht
**Repository Path**: mirrors_libp2p/js-libp2p-kad-dht
## Basic Information
- **Project Name**: js-libp2p-kad-dht
- **Description**: JavaScript implementation of the DHT for libp2p
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-09
- **Last Updated**: 2026-03-28
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 📁 Archived - this module has been merged into [js-libp2p](https://github.com/libp2p/js-libp2p/tree/master/packages/kad-dht)
# @libp2p/kad-dht
[](http://libp2p.io/)
[](https://discuss.libp2p.io)
[](https://codecov.io/gh/libp2p/js-libp2p-kad-dht)
[](https://github.com/libp2p/js-libp2p-kad-dht/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
> JavaScript implementation of the Kad-DHT for libp2p
## Table of contents
- [Install](#install)
- [Browser `
```
```sh
> npm i @libp2p/kad-dht
```
### Use in Node.js
```js
import { create } from '@libp2p/kad-dht'
```
## API
See for the auto generated docs.
The libp2p-kad-dht module offers 3 APIs: Peer Routing, Content Routing and Peer Discovery.
### Custom secondary DHT in libp2p
```js
import { createLibp2pNode } from 'libp2p'
import { kadDHT } from '@libp2p/kad-dht'
const node = await createLibp2pNode({
dht: kadDHT()
//... other config
})
await node.start()
for await (const event of node.dht.findPeer(node.peerId)) {
console.info(event)
}
```
Note that you may want to supply your own peer discovery function and datastore
### Peer Routing
[](https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-interfaces/src/peer-routing)
### Content Routing
[](https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-interfaces/src/content-routing)
### Peer Discovery
[](https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-interfaces/src/peer-discovery)
## Spec
js-libp2p-kad-dht follows the [libp2p/kad-dht spec](https://github.com/libp2p/specs/tree/master/kad-dht) and implements the algorithms described in the [IPFS DHT documentation](https://docs.ipfs.io/concepts/dht/).
## API Docs
-
## License
Licensed under either of
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / )
- MIT ([LICENSE-MIT](LICENSE-MIT) / )
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.