downloading
v0.0.1
Published
Progress bar file download.
Downloads
37
Maintainers
Readme
What is downloading
?
Progress bar file download.
Original package: https://www.npmjs.com/package/progress
Differences: Added title
Installation
npm i downloading
Usage
Import the library in your code:
const Downloading = require('downloading');
let bar = new Downloading(':bar [:title] :percent', {
title: 'Downloading file puppy.png',
width: 50,
total: 100
});
Example
const Downloading = require('downloading');
let bar = new Downloading(':bar [:title] :percent', {
title: 'Download archive with beautiful puppies.',
width: 50,
total: 100
});
let tick = setInterval(() => {
bar.tick(Math.random());
if (bar.curr >= bar.total - 1) {
clearInterval(tick);
bar.tick(1, {
title: 'Archive downloaded'
});
}
}, 300);