0.0.1 • Published 5 years ago

downloading v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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);