downloading-time
v0.0.1
Published
Get a downloading file time
Downloads
7
Maintainers
Readme
Downloading Time
This module calculate the time of downloading files
Installation via npm
npm install downloading-time
Installation via git
git clone https://github.com/byteow/downloading-time.git
npm i
All ready !
Code examples
import { downloadingTime } from 'downloading-time';
const totalBytes = 200000000; // 200 MB
const bytesPeerSecond = 1600000; // 16 MB peer sec
const time = downloadingTime(totalBytes, bytesPeerSecond);
console.log(time);
/*
{
hours: 0,
minutes: 2,
seconds: 48,
totalBytes: 200000000,
bytesPeerSecond: 1600000
}
*/