Skip to content

🎬 Colorful animations in terminal stdout

License

Notifications You must be signed in to change notification settings

hzzly/chalk-animation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chalk-animation

Build Status npm XO code style Code Climate

Colorful animations in terminal stdout

Available animations

Name Preview
rainbow rainbow
pulse rainbow
glitch rainbow
radar rainbow
neon rainbow

Install

$ npm install --save chalk-animation

Usage

const chalkAnimation = require('chalk-animation');

chalkAnimation.rainbow('Lorem ipsum dolor sit amet');

You can stop and restart an animation

const rainbow = chalkAnimation.rainbow('Lorem ipsum'); // Animation starts

setTimeout(() => {
    rainbow.stop(); // Animation stops
}, 1000);

setTimeout(() => {
    rainbow.start(); // Animation resumes
}, 2000);

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);

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

CLI mode

# Install package globally
$ npm install --global chalk-animation
$ chalk-animation --help

Usage
  $ chalk-animation <name> [text...]

Available animations
  rainbow
  pulse
  glitch
  radar
  neon

Example
  $ chalk-animation rainbow Hello world!

Related

License

MIT © Boris K

About

🎬 Colorful animations in terminal stdout

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%