# hyperdrive-network-speed

> track hyperdrive archive upload and download speeds

Latest version **2.1.1** (published 2022-01-06) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install hyperdrive-network-speed
pnpm add hyperdrive-network-speed
yarn add hyperdrive-network-speed
bun add hyperdrive-network-speed
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2022-01-06 |
| First published | 2016-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Joe Hand |
| Maintainers | karissa, maxogden, yoshuawuyts, mafintosh, jhand, rangermauve, leichtgewicht, the-real-dk, pfrazee, frando, cblgh, ninabreznik, serapath, zootella, juliangruber |

## Links

- npm: https://www.npmjs.com/package/hyperdrive-network-speed
- Repository: https://github.com/joehand/hyperdrive-network-speed
- Homepage: https://github.com/joehand/hyperdrive-network-speed#readme
- Issues: https://github.com/joehand/hyperdrive-network-speed/issues
- npm.io page: https://npm.io/package/hyperdrive-network-speed

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^3.1.0
- [speedometer](https://npm.io/package/speedometer.md) ^1.0.0

## Recent versions

- 2.1.1 (latest) — 2022-01-06
- 2.1.0 — 2018-02-20
- 2.0.1 — 2017-04-29
- 2.0.0 — 2017-04-06
- 1.1.2 — 2017-02-28
- 1.1.1 — 2017-02-15
- 1.1.0 — 2017-01-09
- 1.0.1 — 2016-11-30
- 1.0.0 — 2016-11-30

## README

[![deprecated](http://badges.github.io/stability-badges/dist/deprecated.svg)](https://dat-ecosystem.org/) 

More info on active projects and modules at [dat-ecosystem.org](https://dat-ecosystem.org/) <img src="https://i.imgur.com/qZWlO1y.jpg" width="30" height="30" /> 

---

# hyperdrive-network-speed

[![Travis](https://img.shields.io/travis/datproject/hyperdrive-network-speed.svg?style=flat-square)](https://travis-ci.org/datproject/hyperdrive-network-speed) [![npm](https://img.shields.io/npm/v/hyperdrive-network-speed.svg?style=flat-square)](https://npmjs.org/package/hyperdrive-network-speed)

Get upload and download speeds for a hyperdrive archive.

## Usage

```js
var archive = hyperdrive('.dat')
var swarm = hyperdiscovery(archive)
var speed = networkSpeed(archive, {timeout: 1000})

setInterval(function () {
  console.log('upload speed: ', speed.uploadSpeed)
  console.log('download speed: ', speed.downloadSpeed)
}, 500)
```

## API

### `var speed = networkSpeed(archive, [opts])`

* `archive` is a hyperdrive archive.
* `opts.timeout` is the only option. Speed will be reset to zero after the timeout.

#### `speed.uploadSpeed`

Archive upload speed across all peers.

#### `speed.downloadSpeed`

Archive download speed across all peers.

#### `speed.downloadTotal`

Archive total download.

#### `speed.uploadTotal`

Archive total upload.

## License

MIT

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