Not Providing Milkshakes
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

hyperdrive-network-speed

2.1.0 • Public • Published

hyperdrive-network-speed

Travis npm

Get upload and download speeds for a hyperdrive archive.

Usage

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.

License

MIT

Keywords

none

install

npm i hyperdrive-network-speed

Downloadsweekly downloads

349

version

2.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar