Gathering detailed insights and metrics for @figliolia/chalk-animation
Gathering detailed insights and metrics for @figliolia/chalk-animation
Gathering detailed insights and metrics for @figliolia/chalk-animation
Gathering detailed insights and metrics for @figliolia/chalk-animation
npm install @figliolia/chalk-animation
Typescript
Module System
Min. Node Version
Node Version
NPM Version
73.5
Supply Chain
98.8
Quality
76.1
Maintenance
100
Vulnerability
100
License
TypeScript (81.61%)
JavaScript (18.39%)
Total Downloads
3,648
Last Day
15
Last Week
72
Last Month
282
Last Year
3,168
2 Stars
73 Commits
1 Forks
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.4
Package Id
@figliolia/chalk-animation@1.0.4
Unpacked Size
48.73 kB
Size
10.60 kB
File Count
40
NPM Version
10.2.4
Node Version
21.6.1
Publised On
08 Aug 2024
Cumulative downloads
Total Downloads
Last day
7.1%
15
Compared to previous day
Last week
22%
72
Compared to previous week
Last month
-25.6%
282
Compared to previous month
Last year
560%
3,168
Compared to previous year
3
24
Colorful animations in terminal output
Name | Preview |
---|---|
rainbow | |
pulse | |
glitch | |
radar | |
neon | |
karaoke |
1$ npm i @figliolia/chalk-animation
1import { ChalkAnimation } from '@figliolia/chalk-animation'; 2 3ChalkAnimation.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.
1const rainbow = ChalkAnimation.rainbow('Lorem ipsum'); // Animation starts 2 3setTimeout(() => { 4 rainbow.stop(); // Animation stops 5}, 1000); 6 7setTimeout(() => { 8 rainbow.start(); // Animation resumes 9}, 2000); 10
Anything printed to the console will stop the previous animation automatically
1ChalkAnimation.rainbow('Lorem ipsum'); 2setTimeout(() => { 3 // Stop the 'Lorem ipsum' animation, then write on a new line. 4 console.log('dolor sit amet'); 5}, 1000);
Change the animation speed using a second parameter. Should be greater than 0, default is 1.
1ChalkAnimation.rainbow('Lorem ipsum', 2); // Two times faster than default
Change the animated text seamlessly with replace()
1let str = 'Loading...'; 2const rainbow = ChalkAnimation.rainbow(str); 3 4// Add a new dot every second 5setInterval(() => { 6 rainbow.replace(str += '.'); 7}, 1000);
Manually render frames with render()
, or get the content of the next frame with frame()
1const rainbow = ChalkAnimation.rainbow('Lorem ipsum').stop(); // Don't start the animation 2 3rainbow.render(); // Display the first frame 4 5const frame = rainbow.frame(); // Get the second frame 6console.log(frame);
MIT © Alex Figliolia
No vulnerabilities found.
No security vulnerabilities found.