io-spin

TJ Holowaychuk's go-spin node.js port

Usage no npm install needed!

<script type="module">
  import ioSpin from 'https://cdn.skypack.dev/io-spin';
</script>

README

io-spin

NPM version NPM download Build Status: Linux

Little terminal spinner lib for Node.js and io.js

io-spin.gif

Installation

$ npm install io-spin

Example

var spin = require('io-spin')
var spinner = spin('Fetching data')

spinner.start()
spinner.stop()
spinner.update(placeholder)
// upload placeholder
// eg: update Installing 0% to Installing 1%

API

spin(placeholder, type)

placeholder

Type: string
Default: ''

The placeholder to show with the spinner.

type

Type: string
Default: spin1

The spinner type. Checkout all the spinner types!

.start

Start the spinner.

.stop

Stop the spinner and clear it.

.update(placeholder)

Update the placeholder text.

GIF (original from tj/go-spin)

gif

License

MIT © EGOIST