You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anything printed to the console will stop the previous animation automatically
chalkAnimation.rainbow('Lorem ipsum');setTimeout(()=>{// Stop the 'Lorem ipsum' animation, then write on a new line.console.log('dolor sit amet');},1000);
Changing speed
Change the animation speed using a second parameter. Should be greater than 0, default is 1.
chalkAnimation.rainbow('Lorem ipsum',2);// Two times faster than default
Changing text
Change the animated text seamlessly with replace()
letstr='Loading...';constrainbow=chalkAnimation.rainbow(str);// Add a new dot every secondsetInterval(()=>{rainbow.replace(str+='.');},1000);
Manual rendering
Manually render frames with render(), or get the content of the next frame with frame()
constrainbow=chalkAnimation.rainbow('Lorem ipsum').stop();// Don't start the animationrainbow.render();// Display the first frameconstframe=rainbow.frame();// Get the second frameconsole.log(frame);
$ chalk-animation --help
Colorful animations in terminal output
Usage
$ chalk-animation <name> [options] [text...]
Options
--duration Duration of the animation in ms, defaults to Infinity
--speed Animation speed as number > 0, defaults to 1
Available animations
rainbow
pulse
glitch
radar
neon
karaoke
Example
$ chalk-animation rainbow Hello world!