Terminal loading effect.
$ npm install --save loading-cliconst 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.