All Projects → bokub → Chalk Animation

bokub / Chalk Animation

Licence: mit
🎬 Colorful animations in terminal output

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Chalk Animation

Chalk
🖍 Terminal string styling done right
Stars: ✭ 17,566 (+1079.72%)
Mutual labels:  terminal, console, color, chalk
Box Cli Maker
Make Highly Customized Boxes for your CLI
Stars: ✭ 115 (-92.28%)
Mutual labels:  terminal, console, color
Php Console Spinner
Colorful highly configurable spinner for php cli applications (suitable for async apps)
Stars: ✭ 225 (-84.89%)
Mutual labels:  terminal, console, color
log-utils
Basic logging utils: colors, symbols and timestamp.
Stars: ✭ 24 (-98.39%)
Mutual labels:  console, color, chalk
Closestx11color
Find the closest xterm-256 colors (between 0 and 255) to an arbitrary HTML hexa color (e.g. #ABCDEF)
Stars: ✭ 13 (-99.13%)
Mutual labels:  terminal, console, color
Crossline
A small, self-contained, zero-config, MIT licensed, cross-platform, readline and libedit replacement.
Stars: ✭ 53 (-96.44%)
Mutual labels:  terminal, console, color
yachalk
🖍️ Terminal string styling done right
Stars: ✭ 131 (-91.2%)
Mutual labels:  console, color, chalk
Mordant
Full-featured text styling for Kotlin command-line applications
Stars: ✭ 382 (-74.35%)
Mutual labels:  terminal, console, color
Gradient String
🌈 Beautiful color gradients in terminal output
Stars: ✭ 476 (-68.03%)
Mutual labels:  terminal, console, color
Crossterm
Cross platform terminal library rust
Stars: ✭ 1,023 (-31.3%)
Mutual labels:  terminal, console, color
Rang
A Minimal, Header only Modern c++ library for terminal goodies 💄✨
Stars: ✭ 1,080 (-27.47%)
Mutual labels:  terminal, console, color
Colors
List of 256 color codes for Xterm including an example of the color, Xterm Name, Xterm Number, HEX, RGB and HSL code.
Stars: ✭ 73 (-95.1%)
Mutual labels:  terminal, color
Tiza
Console styling for browsers
Stars: ✭ 74 (-95.03%)
Mutual labels:  console, color
I3 Quickterm
A small drop-down terminal for i3 and sway
Stars: ✭ 76 (-94.9%)
Mutual labels:  terminal, console
Phetch
🐭 quick lil gopher client for your terminal
Stars: ✭ 108 (-92.75%)
Mutual labels:  terminal, console
Listr2
NodeJS Task List derived from the best! Create beautiful CLI interfaces via easy and logical to implement task lists that feel alive and interactive.
Stars: ✭ 73 (-95.1%)
Mutual labels:  terminal, console
Taskline
Tasks, boards & notes for the command-line habitat
Stars: ✭ 78 (-94.76%)
Mutual labels:  terminal, console
Word Wrap
Wrap words to a specified length.
Stars: ✭ 107 (-92.81%)
Mutual labels:  terminal, console
Window Size
Reliable way to to get the height and width of the terminal/console in a node.js environment.
Stars: ✭ 79 (-94.69%)
Mutual labels:  terminal, console
Headmore
Top geek’s VNC client that runs in Linux terminal (Linux VT console, xterm, and more)
Stars: ✭ 82 (-94.49%)
Mutual labels:  terminal, console

chalk-animation

Build Status npm Codecov npm XO code style

Colorful animations in terminal output

Available animations

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

Install

$ npm i chalk-animation

Usage

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

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

Start and stop

You can stop and resume an animation with stop() and start().

When created, the instance of chalkAnimation starts automatically.

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

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

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

Automatic stop

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

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

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

Manual rendering

Manually render frames with render(), or get the content of the next frame with frame()

const rainbow = chalkAnimation.rainbow('Lorem ipsum').stop(); // Don't start the animation

rainbow.render(); // Display the first frame

const frame = rainbow.frame(); // Get the second frame
console.log(frame);

CLI mode

# Install package globally
$ npm install --global chalk-animation
$ 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!

Related

License

MIT © Boris K

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].