Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chalk-animation

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chalk-animation

Colorful animations in terminal stdout

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13K
decreased by-1.94%
Maintainers
1
Weekly downloads
 
Created
Source

chalk-animation

Build Status npm XO code style Code Climate

Colorful animations in terminal stdout

Available animations

NamePreview
rainbowrainbow
pulserainbow
glitchrainbow
radarrainbow
neonrainbow

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 with stop() and start()

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

Change the animated text seamlessly with replace()

let str = 'Loading...';
const rainbow = chalkAnimation.rainbow(str);

// Add a new dot every second
setInterval(() => {
	str += '.';
	rainbow.replace(str);
}, 1000);

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!
  • gradient-string - Output gradients to terminal
  • chalk - Output colored text to terminal

License

MIT © Boris K

Keywords

FAQs

Package last updated on 21 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc