Terminal loading effect.
$ npm install --save loading-cli
const loading = require('loading-cli');
const load = loading("loading text!!").start()
setTimeout(function(){
load.color = 'yellow';
load.text = ' Loading rainbows';
},2000)
// stop
setTimeout(function(){
load.stop()
},3000)
Custom text color colors-cli
const color = require('colors-cli/toxic');
const loading = require('loading-cli');
const load = loading("loading text!!".blue).start();
// stop
setTimeout(function(){
load.stop()
},3000)
load({
"text":"loading text!!",
"color":"yellow",
"interval":100,
"stream": process.stdout,
"frames":["◰", "◳", "◲", "◱"]
})
Type: string Text to display after the spinner.
loading("loading text!!")
Values:black
red
green
yellow
blue
magenta
cyan
white
gray
["◰", "◳", "◲", "◱"]
["◐", "◓", "◑", "◒"]
[".", "o", "O", "°", "O", "o", "."]
["⊶", "⊷"]
["ဝ", "၀"]
["←", "↖", "↑", "↗", "→", "↘", "↓", "↙"]
["🕐 ", "🕑 ", "🕒 ", "🕓 ", "🕔 ", "🕕 ", "🕖 ", "🕗 ", "🕘 ", "🕙 ", "🕚 "]
Start the spinner. Returns the instance.
Stop and clear the spinner. Returns the instance.
Clear the spinner. Returns the instance.
Stop the spinner, change it to a green ✔
and persist the current text, or text if provided. Returns the instance. See the GIF below.
Stop the spinner, change it to a red ✖
and persist the current text, or text if provided. Returns the instance. See the GIF below.
Stop the spinner, change it to a yellow ⚠
and persist the current text, or text if provided. Returns the instance.
Stop the spinner, change it to a blue ℹ
and persist the current text, or text if provided. Returns the instance.
Manually render a new frame. Returns the instance.
Get a new frame.
const loading = require('loading-cli');
const load = loading("loading text!!");
load.frame(["◰", "◳", "◲", "◱"]);
load.start();
Change the text.
Change the spinner color.
As always, thanks to our amazing contributors!
Made with contributors.
Licensed under the MIT License.