JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10544
  • Score
    100M100P100Q124261F
  • License MIT

Terminal loading effect.

Package Exports

  • loading-cli

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (loading-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

loading-cli

Build Status

Terminal loading effect.

Install

$ npm install --save loading-cli

Usage

var loading =  require('loading-cli');
var load = loading("loading text!!")

load.start()

setTimeout(function(){
    load.color = 'yellow';
    load.text = ' Loading rainbows';
},2000)

// stop
setTimeout(function(){
    load.stop()
},3000)

API

loading([options|text])

options

load({
    "text":"loading text!!",
    "color":"yellow",
    "interval":100,
    "stream": process.stdout,
    "frames":["◰", "◳", "◲", "◱"]
})

text

Type: string Text to display after the spinner.

loading("loading text!!")

color

Values:black red green yellow blue magenta cyan white gray

frames

["◰", "◳", "◲", "◱"]
["◐", "◓", "◑", "◒"]
[".", "o", "O", "°", "O", "o", "."]
["⊶", "⊷"]
["ဝ", "၀"]
["←", "↖", "↑", "↗", "→", "↘", "↓", "↙"]
["🕐 ", "🕑 ", "🕒 ", "🕓 ", "🕔 ", "🕕 ", "🕖 ", "🕗 ", "🕘 ", "🕙 ", "🕚 "]

Instance

.start()

Start the spinner. Returns the instance.

.stop()

Stop and clear the spinner. Returns the instance.

.clear()

Clear the spinner. Returns the instance.

.render()

Manually render a new frame. Returns the instance.

.frame()

Get a new frame.

.text

Change the text.

.color

Change the spinner color.