1.0.0 • Published 6 years ago

eider.js v1.0.0

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

eider.js

eider.js is a simple CLI-progress bar for Node.

Demonstration

Inspired by Symfony Progress Bar (https://symfony.com/doc/current/components/console/helpers/progressbar.html)

Installation

With NPM (recommended)

npm install eider.js --save

With Git

git clone https://github.com/Treast/eider.js.git mv ./eider.js/lib/eider.js ./foo/bar

Usage

Import

const Eider = require('eider');

Example

  const  Eider  =  require('../lib/eider');

  // new Eider(progressBarSteps, progressBarLength, progressBarOptions)
  let  eider  =  new  Eider(50,  40);
  
  setInterval(()  =>  {
    eider.advance();
  },  300);
  
  eider.start();

Options

NameTypeDefaultDescription
startCharchar[First character of the progress bar
endCharchar]Last character of the progress bar
doneCharchar#Character displayed when the step is done
currentCharchar>Character displayed when the step is currently doing
undoneCharchar-Character displayed when the step is undone
countbooleantrueDisplay the step count
percentagebooleantrueDisplay the percentage

Methods

MethodsDescription
start()Start the progress bar
stop()Stop the progress bar
advance(n)Increment the progress bar by n steps