npm.io
2.0.7 • Published 6 years ago

bytespin

Licence
Apache-2.0
Version
2.0.7
Deps
2
Size
53 kB
Vulns
0
Weekly
0
Stars
15

bytespin

npm version npm

spinner nanocomponent that cycles through a given list of characters ( demo )

installation

npm install --save bytespin

usage

spinner = Spinner(opts) creates a new Spinner instance.

{
  chars: string  // characters to cycle through
  speed: number // spinning speed in ms
}

example

var Spinner = require('bytespin')
var spinner = Spinner({ chars: '\\|/-', speed: 125 })

function view (state, emit) {
  return `
    <div>
      ${spinner.render(state.fetching)}
    </div>`
}

Keywords