{"id":13476101,"url":"https://github.com/bokub/chalk-animation","last_synced_at":"2025-05-14T12:12:46.028Z","repository":{"id":23212831,"uuid":"97959341","full_name":"bokub/chalk-animation","owner":"bokub","description":":clapper: Colorful animations in terminal output","archived":false,"fork":false,"pushed_at":"2022-11-13T10:59:52.000Z","size":826,"stargazers_count":2150,"open_issues_count":5,"forks_count":72,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-11T05:59:50.771Z","etag":null,"topics":["animation","chalk","color","console","nodejs","npm-package","terminal"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bokub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-21T14:57:56.000Z","updated_at":"2025-04-09T21:43:57.000Z","dependencies_parsed_at":"2023-01-13T22:57:16.486Z","dependency_job_id":null,"html_url":"https://github.com/bokub/chalk-animation","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bokub%2Fchalk-animation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bokub%2Fchalk-animation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bokub%2Fchalk-animation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bokub%2Fchalk-animation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bokub","download_url":"https://codeload.github.com/bokub/chalk-animation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254140768,"owners_count":22021220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","chalk","color","console","nodejs","npm-package","terminal"],"created_at":"2024-07-31T16:01:26.597Z","updated_at":"2025-05-14T12:12:41.018Z","avatar_url":"https://github.com/bokub.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Packages","animation","Colorize"],"sub_categories":["CLI Tools","Console"],"readme":"# chalk-animation\n\n[![Build Status](https://flat.badgen.net/github/checks/bokub/chalk-animation?label=tests)](https://github.com/bokub/chalk-animation/actions/workflows/run.yml)\n[![Version](https://runkit.io/bokub/npm-version/branches/master/chalk-animation?style=flat)](https://www.npmjs.com/package/chalk-animation)\n[![Codecov](https://flat.badgen.net/codecov/c/github/bokub/chalk-animation)](https://codecov.io/gh/bokub/chalk-animation)\n[![Downloads](https://flat.badgen.net/npm/dm/chalk-animation?color=FF9800)](https://www.npmjs.com/package/chalk-animation)\n[![XO code style](https://flat.badgen.net/badge/code%20style/XO/5ed9c7)](https://github.com/sindresorhus/xo)\n\n\u003e Colorful animations in terminal output\n\n\n## Available animations\n\n|   Name    |                   Preview                  |\n|:---------:|:------------------------------------------:|\n|  rainbow  | ![rainbow](http://i.imgur.com/napdxdn.gif) |\n|   pulse   | ![pulse](http://i.imgur.com/xdaETwr.gif)   |\n|   glitch  | ![glitch](http://i.imgur.com/834FJU1.gif)  |\n|   radar   | ![radar](http://i.imgur.com/3bFrtRc.gif)   |\n|    neon   | ![neon](http://i.imgur.com/YdAAroI.gif)    |\n|  karaoke  | ![karaoke](https://i.imgur.com/lG7EF1t.gif)|\n\n\n## Install\n\n```bash\n$ npm i chalk-animation\n```\n\n\n## Usage\n\n```javascript\nimport chalkAnimation from 'chalk-animation';\n\nchalkAnimation.rainbow('Lorem ipsum dolor sit amet');\n```\n\n#### Start and stop\n\nYou can stop and resume an animation with `stop()` and `start()`.\n\nWhen created, the instance of chalkAnimation **starts automatically**.\n\n```javascript\nconst rainbow = chalkAnimation.rainbow('Lorem ipsum'); // Animation starts\n\nsetTimeout(() =\u003e {\n    rainbow.stop(); // Animation stops\n}, 1000);\n\nsetTimeout(() =\u003e {\n    rainbow.start(); // Animation resumes\n}, 2000);\n\n```\n\n#### Automatic stop\n\nAnything printed to the console will stop the previous animation automatically\n\n```javascript\nchalkAnimation.rainbow('Lorem ipsum');\nsetTimeout(() =\u003e {\n    // Stop the 'Lorem ipsum' animation, then write on a new line.\n    console.log('dolor sit amet');\n}, 1000);\n```\n\n#### Changing speed\n\nChange the animation speed using a second parameter. Should be greater than 0, default is 1.\n\n```javascript\nchalkAnimation.rainbow('Lorem ipsum', 2); // Two times faster than default\n```\n\n#### Changing text\n\nChange the animated text seamlessly with `replace()`\n\n```javascript\nlet str = 'Loading...';\nconst rainbow = chalkAnimation.rainbow(str);\n\n// Add a new dot every second\nsetInterval(() =\u003e {\n\trainbow.replace(str += '.');\n}, 1000);\n```\n\n#### Manual rendering\n\nManually render frames with `render()`, or get the content of the next frame with `frame()`\n\n```javascript\nconst rainbow = chalkAnimation.rainbow('Lorem ipsum').stop(); // Don't start the animation\n\nrainbow.render(); // Display the first frame\n\nconst frame = rainbow.frame(); // Get the second frame\nconsole.log(frame);\n```\n\n\n## CLI mode\n\n```bash\n# Install package globally\n$ npm install --global chalk-animation\n```\n\n```\n$ chalk-animation --help\n\n  Colorful animations in terminal output\n\n  Usage\n    $ chalk-animation \u003cname\u003e [options] [text...]\n\n  Options\n    --duration  Duration of the animation in ms, defaults to Infinity\n    --speed  Animation speed as number \u003e 0, defaults to 1\n\n  Available animations\n    rainbow\n    pulse\n    glitch\n    radar\n    neon\n    karaoke\n\n  Example\n    $ chalk-animation rainbow Hello world!\n```\n\n\n## Related\n\n- [gradient-string](https://github.com/bokub/gradient-string) - Output gradients to terminal\n- [chalk](https://github.com/chalk/chalk) - Output colored text to terminal\n\n\n## License\n\nMIT © [Boris K](https://github.com/bokub)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbokub%2Fchalk-animation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbokub%2Fchalk-animation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbokub%2Fchalk-animation/lists"}