{"id":17975548,"url":"https://github.com/rafaelrinaldi/loading-indicator","last_synced_at":"2025-03-25T14:33:00.429Z","repository":{"id":41819711,"uuid":"40214759","full_name":"rafaelrinaldi/loading-indicator","owner":"rafaelrinaldi","description":":vertical_traffic_light: Simple and customizable command line loading indicator","archived":false,"fork":false,"pushed_at":"2017-10-27T05:31:45.000Z","size":127,"stargazers_count":19,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T05:05:44.895Z","etag":null,"topics":["cli","emoji","indicator","loading","spinner"],"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/rafaelrinaldi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-08-04T23:53:33.000Z","updated_at":"2022-11-23T08:06:43.000Z","dependencies_parsed_at":"2022-09-01T00:21:16.107Z","dependency_job_id":null,"html_url":"https://github.com/rafaelrinaldi/loading-indicator","commit_stats":null,"previous_names":["rafaelrinaldi/idle.js"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelrinaldi%2Floading-indicator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelrinaldi%2Floading-indicator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelrinaldi%2Floading-indicator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelrinaldi%2Floading-indicator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafaelrinaldi","download_url":"https://codeload.github.com/rafaelrinaldi/loading-indicator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217774,"owners_count":20579297,"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":["cli","emoji","indicator","loading","spinner"],"created_at":"2024-10-29T17:19:53.228Z","updated_at":"2025-03-25T14:33:00.127Z","avatar_url":"https://github.com/rafaelrinaldi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# loading-indicator [![Build Status](https://semaphoreci.com/api/v1/projects/aa124d8d-865f-4a05-ac30-1b47c246ddbe/681927/badge.svg)](https://semaphoreci.com/rafaelrinaldi/loading-indicator)\n\n\u003e Simple and customizable command line loading indicator\n\n## Install\n**Warning: `v2.0.0` is a complete rewrite of the previous implementation.**\n```sh\n$ npm install loading-indicator --save\n```\n\n## Usage\n\n```js\nimport loading from 'loading-indicator';\n\n// Initialize the loading animation and saves the timer id\nconst timer = loading.start();\n\n// 1500ms later, stop the loading animation passing along the timer id\nsetTimeout(() =\u003e {\n  loading.stop(timer);\n}, 1500);\n```\n\n![demo-default](./demo-default.gif)\n\n### Presets\n\n```js\nimport loading from 'loading-indicator';\n// Import available presets\nimport presets from 'loading-indicator/presets';\n\n// Use an available preset (or simply provides an array with your custom preset)\nconst timer = loading.start(null, {\n  frames: presets.arrows\n});\n```\n\n![demo-presets](./demo-presets.gif)\n\n### Custom text\n\n```js\nimport loading from 'loading-indicator';\n\n// Setup a custom loading text\nconst timer = loading.start('Loading...');\n```\n\n![demo-custom-text](./demo-custom-text.gif)\n\n## API\n\n## `loading.start([text], [options])`\n\nReturns a `number` with the id that is used to reset the render interval (later referenced as _timer_).\n\n### `text`\n\nType: `string`  \nDefault: `null`  \n\nText do append to the indicator symbol.\n\n### `options`\n\nType: `object`  \n\nAvailable options.\n\n#### `options.delay`\n\nType: `number` _(milliseconds)_  \nDefault: `100`  \n\nDelay for the render to be triggered.\n\n#### `options.frames`\n\nType: `array`  \nDefault: [`presets.spinner`](./presets.js#L2)  \n\nFrames for the loading animation sequence.\n\nAvailable presets are:\n\n* [`spinner`](./presets.js#L2) (default)\n* [`circle`](./presets.js#3)\n* [`dots`](./presets.js#4)\n* [`bullets`](./presets.js#5)\n* [`arrows`](./presets.js#11)\n* [`clock`](./presets.js#19)\n\n## `loading.stop(timer, [shouldKeepOutput])`\n\n### `timer`\n\n_Required_  \nType: `number` _(integer)_\n\nId of the render function interval.\n\n### `shouldKeepOutput`\n\nType: `boolean`  \nDefault: `false`  \n\nWhether or not to keep the output when `loading.stop()` is called.\n\n## License\n\nMIT :copyright: [Rafael Rinaldi](http://rinaldi.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelrinaldi%2Floading-indicator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelrinaldi%2Floading-indicator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelrinaldi%2Floading-indicator/lists"}