Git Product home page Git Product logo

emoji-progress's Introduction

emoji-progress

A cli progress-bar with the power of imagination ๐ŸŒˆ ( and emoji's ๐Ÿ˜ป)

Progress Bar

const EmojiBar = require('emoji-progress');

const progress = new EmojiBar({
  start: 10,
  end: 100,
  unit: '๐Ÿ˜'
});
progress.start();
setTimeout(() => {
  progress.increase(40);
  setTimeout(() => {
    progress.increase(70);
  }, 3000);
}, 3000);

Loading Bar

const EmojiBar = require('emoji-progress');

const loader = new EmojiBar({
  hideState: true,
  isLoader: true,
  autostart: true
});
setTimeout(() => {
  loader.complete();
}, 3000);

Config

startValue

Defines the value at wich the progress bar starts.
startValue: 10
Default: 10

endValue

Defines the value at wich the progress bar end.
endValue: 150
Default: 100

isLoader

The Emojibar will now be a infiniteloader.
endValue: true
Default: false

hideState

The state (0 of 100 unit) will be hidden.
hideState: true
Default: false

autostart

The bar will start on initialisation.
autostart: true
Default: false

reverse

Sets the direction to right to left.
reverse: true
Default: false

indicator

Sets the indicator.
indicator: '๐Ÿคฉ'
Default: 'โค๏ธ'

unit

Sets the unit (10 of 100 ๐ŸŒ).
unit: 'Steps'
Default: '๐ŸŒ'

separator

Sets the separator (| 10 of 100).
separator: '||'
Default: '|'

paddingRight

Sets the padding. This can be used if you the loader uses more than one line.
paddingRight: 5
Default: 0

paddingRight

Sets the padding. This can be used if you the loader uses more than one line.
paddingRight: '||'
Default: '|'

fillerLeft

Sets the filler at the left of the indicator.
fillerLeft: '#'
Default: '-'

fillerRight

Sets the filler at the left of the indicator.
fillerRight: '-'
Default: ' '

intervalTime

Sets the interval time. This is the refresh rate of the progress bar and the interval of the loader
intervalTime: '1000'
Default: 200

Examples

Simple

const progress = new EmojiBar({
  start: 10,
  end: 100,
  unit: '๐Ÿ˜',
  paddingRight: 1,
  fillerLeft: '-',
  indicator: '๐Ÿ˜œ->'
});
progress.start();
setTimeout(() => {
  progress.increase(40);
  setTimeout(() => {
    progress.increase(70);
  }, 3000);
}, 3000);

Nyan Cat

const loader = new EmojiBar({
  hideState: true,
  indicator: '๐Ÿˆ',
  reverse: true,
  fillerLeft: '๐ŸŒˆ',
  isLoader: true,
  autostart: true,
  intervalTime: 100,
});

Banana

const progress = new EmojiBar({
  start: 10,
  end: 100,
  unit: '๐ŸŒ',
  fillerRight: '๐ŸŒ   ',
  fillerLeft: ' ',
  indicator: '๐Ÿฆ  ๐Ÿ…',
  isLoader: true,
  autostart: true,
  reverse: true
});
progress.start();
setTimeout(() => {
  progress.increase(40);
  setTimeout(() => {
    progress.increase(70);
  }, 10000);
}, 3000);

emoji-progress's People

Contributors

benji24290 avatar

Stargazers

 avatar Alexander avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.