
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@figliolia/chalk-animation
Advanced tools
An ESM/Common.js compatible typescript port of the popular 'chalk-animation' library
Colorful animations in terminal output
Name | Preview |
---|---|
rainbow | ![]() |
pulse | ![]() |
glitch | ![]() |
radar | ![]() |
neon | ![]() |
karaoke | ![]() |
$ npm i @figliolia/chalk-animation
import { ChalkAnimation } from '@figliolia/chalk-animation';
ChalkAnimation.rainbow('Lorem ipsum dolor sit amet');
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);
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(() => {
rainbow.replace(str += '.');
}, 1000);
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);
MIT © Alex Figliolia
FAQs
An ESM/Common.js compatible typescript port of the popular 'chalk-animation' library
The npm package @figliolia/chalk-animation receives a total of 63 weekly downloads. As such, @figliolia/chalk-animation popularity was classified as not popular.
We found that @figliolia/chalk-animation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.