Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/node/TestCli/node_modules/chalk-animation/examples/demo.js
2022-09-04 12:45:01 +02:00

21 lines
467 B
JavaScript

const chalkAnimation = require('..');
const str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit\n';
const cls = `\u001B[2J\u001B[0;0H`;
const effects = ['rainbow', 'pulse', 'glitch', 'radar', 'neon', 'karaoke'];
console.log(cls);
console.log(str);
const i = setInterval(() => {
if (effects.length === 0) {
clearInterval(i);
return;
}
const e = effects.shift();
console.log(cls);
setTimeout(() => {
chalkAnimation[e](str);
}, 500);
}, 7000);