Skip to content

egoist/hinata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hinata NPM version NPM downloads Build Status

Your cli spinner which like a marquee.

gif

Install

$ npm install --save hinata

Usage

const Hinata = require('hinata')

const hinata = new Hinata({char: '❤', spacing: 2})

hinata.start()

setTimeout(() => {
  // update loading text
  hinata.text = 'loading something'
}, 2000)

setTimeout(() => {
  // update loading character
  hinata.char = '.'
  // update character spacing
  hinata.spacing = 0
}, 3000)

setTimeout(() => {
  hinata.stop()
}, 10000)

API

new Hinata([options])

options

text

default ''

Placeholder for loading text, eg: Loading in Loading ...

char

default .

Loading character, eg: in ❤ ❤ ❤ loading webpack

length

default 3

How many time a loading character should repeat itself.

color

default false

If set to be true, spinner uses your color instead of a random color.

spacing

default 0

How many spaces between each loading character.

timeout

default 100

The timeout to update the spinner.

prepend

default false

Show loading text at the beginning of the spinner.

Related

  • io-spin: Cli spinner made simple.

License

MIT © EGOIST

About

🚥 Your cli spinner which like a marquee.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published