particle-iot/node-spinner

Name: node-spinner

Owner: Particle

Description: A simple spinner for node cli

Created: 2015-05-12 05:51:22.0

Updated: 2015-05-12 05:51:23.0

Pushed: 2018-01-03 18:35:56.0

Homepage: null

Size: 13

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

node-spinner

A simple spinner for node cli.

NPM version


Installation

This package is available on npm as cli-spinner.

install cli-spinner
Example usage
Spinner = require('cli-spinner').Spinner;

spinner = new Spinner('processing.. %s');
ner.setSpinnerString('|/-\\');
ner.start();
API

var obj = new Spinner('title')

Creates a new spinner object with the default options.

obj.start()

Starts the spinner.

obj.stop(clean)

Stops the spinner. Accepts a Boolean parameter to clean the console.

obj.setSpinnerString(spinnerString)

Sets the spinner string. Accepts either a String or an Integer index to reference the built-in spinners.

obj.setSpinnerDelay(spinnerDelay)

Sets the spinner animation speed.

Spinner.setDefaultSpinnerString(spinnerString)

Sets the default spinner string for all newly created instances. Accepts either a String or an Integer index to reference the built-in spinners.

Spinner.setDefaultSpinnerDelay(spinnerDelay)

Sets the default spinner delay for all newly created instances.

Demo

To see a demonstration of the built-in spinners, point your console at the example folder and run:

 spinner.js

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.