# bitrate

> Calculates the bitrate given a file's size and duration

Latest version **1.0.4** (published 2016-01-08) · VOL license · 0 weekly downloads

## Install

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

## 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 | 1.0.4 |
| Published | 2016-01-08 |
| First published | 2015-09-11 |
| Weekly downloads | 0 |
| License | VOL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | ArtskydJ |
| Maintainers | artskydj |
| Keywords | bitrate, bytes, duration, bit, rate, bit rate |

## Links

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

## Recent versions

- 1.0.4 (latest) — 2016-01-08
- 1.0.3 — 2015-12-23
- 1.0.2 — 2015-09-11
- 1.0.1 — 2015-09-11
- 1.0.0 — 2015-09-11

## README

bitrate
=========

> Calculates the bitrate given a file's size and duration

[![Build Status](https://travis-ci.org/ArtskydJ/bitrate.svg)](https://travis-ci.org/ArtskydJ/bitrate)

# example

```js
var bitrate = require('bitrate')

var bytes = 6076940
var seconds = 149

var kilobitsPerSecond = bitrate(bytes, seconds) // => 326.3
var bitsPerSecond = bitrate(bytes, seconds, 'bps') // => 326279
var BytesPerSecond = bitrate(bytes, seconds, 'Bps') // => 40785
```

# api

```js
var bitrate = require('bitrate')
```

## `var rate = bitrate(bytes, seconds, [format])`

- `bytes` is a number of bytes
- `seconds` is a number of the duration in seconds
- `format` is a string of the desired format. Accepts:
	- `bps`, `b/s`; bits per second
	- `kbps`, `kb/s`; kilobits per second **default**
	- `mbps`, `mb/s`; megabits per second
	- `Bps`, `B/s`; bytes per second
	- `KBps`, `KB/s`; kilobytes per second
	- `MBps`, `MB/s`; megabytes per second
- **Returns** `rate` number

# install

With [npm](http://nodejs.org/download) do:

	npm install bitrate

# license

[VOL](http://veryopenlicense.com)

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