# dht-size-up

> Estimate the size of a DHT using find_node queries

Latest version **2.0.0** (published 2023-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install dht-size-up
pnpm add dht-size-up
yarn add dht-size-up
bun add dht-size-up
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-10-24 |
| First published | 2020-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Christophe Diederichs |
| Maintainers | chm-diederichs |
| Keywords | DHT |

## Links

- npm: https://www.npmjs.com/package/dht-size-up
- Repository: https://github.com/chm-diederichs/dht-size-up
- Homepage: https://github.com/chm-diederichs/dht-size-up#readme
- Issues: https://github.com/chm-diederichs/dht-size-up/issues
- npm.io page: https://npm.io/package/dht-size-up

## Dependencies (1)

- [sha256-wasm](https://npm.io/package/sha256-wasm.md) ^2.1.2

## Recent versions

- 2.0.0 (latest) — 2023-10-24
- 1.1.0 — 2020-12-19
- 1.0.3 — 2020-12-18
- 1.0.2 — 2020-12-18
- 1.0.1 — 2020-12-18
- 1.0.0 — 2020-05-14
- 0.0.4 — 2020-05-14
- 0.0.3 — 2020-05-12
- 0.0.2 — 2020-05-12
- 0.0.1 — 2020-05-12
- 0.0.0 — 2020-05-12

## README

# dht-size-up

Estimate the size of a DHT using find_node queries.

```
npm install dht-size-up
```

## Usage

``` js
const size = require('dht-size-up')
const dht = require('dht-rpc')

var bootstrap = dht({ ephemeral: true })
bootstrap.listen(10001)

createNodes(1000)

function createNodes (n) {
  dht({ bootstrap: ['localhost:10001'] })
    .on('ready', function () {
      if (n === 0) return size(bootstrap, console.log)
      return createNodes(--n)
    })
}
```

## API

#### size(dht, [n = 1000], cb)

Returns an estimate of the size of the DHT or an error to the callback `cb`. `dht` should be node capable of performing `_find_node` queries to the network. `n` is the number of trials to perform, default is 1000.

## License

MIT

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