Socket
Socket
Sign inDemoInstall

bitrate

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bitrate

Calculates the bitrate given a file's size and duration


Version published
Weekly downloads
10
increased by66.67%
Maintainers
1
Install size
4.66 kB
Created
Weekly downloads
 

Readme

Source

bitrate

Calculates the bitrate given a file's size and duration

Build Status

example

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

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 do:

npm install bitrate

license

VOL

Keywords

FAQs

Last updated on 08 Jan 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc