# throughput

> Speed measurment

Latest version **1.0.2** (published 2025-08-04) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2025-08-04 |
| First published | 2022-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | ThaUnknown |
| Maintainers | thaunknown |
| Keywords | throughput, speedometer, bandwidth, meter |

## Links

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

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2025-08-04
- 1.0.1 — 2022-05-14
- 1.0.0 — 2022-05-10

## README

# throughput

Speed measurement

```
npm install throughput
```

## Usage

``` js
const throughput = require('throughput')
const fs = require('fs')

// Let's measure how fast we can read from /dev/urandom
const speed = throughput()
const stream = fs.createReadStream('/dev/urandom')

stream.on('data', function(data) {
  // Simply call speed with the amount of bytes transferred
  const bytesPerSecond = speed(data.length)

  console.log(bytesPerSecond+' bytes/second')
})
```

You can always get the current speed by calling `speed()`.

Per default `throughput` uses a 5 second buffer.
To change this simply pass another value to the constructor

``` js
const speed = throughput(20) // uses a 20s buffer instead
```

This is an improved version of `speedometer` by `mafintosh`, which used timeouts, which cause a lot of issues.

## License

MIT

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