Terminal loading effect.

$npminstall--save loading-cliconst loading=require('loading-cli');const load=loading("loading text!!").start()setTimeout(function(){ load.color='yellow'; load.text=' Loading rainbows';},2000)// stopsetTimeout(function(){ load.stop()},3000)Custom text colorcolors-cli
const color=require('colors-cli/toxic');const loading=require('loading-cli');const load=loading("loading text!!".blue).start();// stopsetTimeout(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:blackredgreenyellowbluemagentacyanwhitegray
["◰","◳","◲","◱"]["◐","◓","◑","◒"][".","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 withcontributors.
Licensed under the MIT License.