{"id":19475448,"url":"https://github.com/artdecocode/indicatrix","last_synced_at":"2025-02-25T15:47:01.616Z","repository":{"id":57273491,"uuid":"157114876","full_name":"artdecocode/indicatrix","owner":"artdecocode","description":"A CLI Loading Indicator Implemented As A Changing Elipsis.","archived":false,"fork":false,"pushed_at":"2020-01-28T19:44:16.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T14:41:54.744Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.artd.eco","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/artdecocode.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":"2018-11-11T19:47:49.000Z","updated_at":"2020-01-28T19:44:19.000Z","dependencies_parsed_at":"2022-09-17T05:10:33.164Z","dependency_job_id":null,"html_url":"https://github.com/artdecocode/indicatrix","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Findicatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Findicatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Findicatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Findicatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artdecocode","download_url":"https://codeload.github.com/artdecocode/indicatrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240699224,"owners_count":19843509,"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":[],"created_at":"2024-11-10T19:32:53.742Z","updated_at":"2025-02-25T15:47:01.580Z","avatar_url":"https://github.com/artdecocode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# indicatrix\n\n[![npm version](https://badge.fury.io/js/indicatrix.svg)](https://www.npmjs.com/package/indicatrix)\n\n`indicatrix` Is A CLI Loading Indicator Implemented As A Changing Ellipsis (Triple-Dot).\n\n![ellipsis demo](/images/ellipsis.gif)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/0.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e\n\n```sh\nyarn add -E indicatrix\n```\n\n## Table Of Contents\n\n- [Table Of Contents](#table-of-contents)\n- [API](#api)\n- [`async indicatrix(text, promise, options=): T`](#async-indicatrixtext-stringpromise-promisetfunction-promisetoptions-options-t)\n  * [`Options`](#type-options)\n- [`INDICATRIX_PLACEHOLDER` env](#indicatrix_placeholder-env)\n- [Copyright](#copyright)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/1.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e\n\n## API\n\nThe package is available by importing its default function:\n\n```js\nimport indicatrix from 'indicatrix'\n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/2.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e\n\n## \u003ccode\u003easync \u003cins\u003eindicatrix\u003c/ins\u003e(\u003c/code\u003e\u003csub\u003e\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`text: string,`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`promise: !Promise\u003cT\u003e|function(...*): !Promise\u003cT\u003e,`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`options=: !Options,`\u003cbr/\u003e\u003c/sub\u003e\u003ccode\u003e): \u003ci\u003eT\u003c/i\u003e\u003c/code\u003e\nWill print the loading text and refresh the CLI line to show the ellipsis while the promise is loading.\n\n - \u003ckbd\u003e\u003cstrong\u003etext*\u003c/strong\u003e\u003c/kbd\u003e \u003cem\u003e`string`\u003c/em\u003e: The text to display in the CLI.\n - \u003ckbd\u003e\u003cstrong\u003epromise*\u003c/strong\u003e\u003c/kbd\u003e \u003cem\u003e\u003ccode\u003e(!Promise\u0026lt;T\u0026gt; \\| function(...*): !Promise\u0026lt;T\u0026gt;)\u003c/code\u003e\u003c/em\u003e: The promise or an async function that returns the promise.\n - \u003ckbd\u003eoptions\u003c/kbd\u003e \u003cem\u003e\u003ccode\u003e\u003ca href=\"#type-options\" title=\"The optional options for the indicator, such as the refresh interval.\"\u003e!Options\u003c/a\u003e\u003c/code\u003e\u003c/em\u003e (optional): The optional options for the indicator, such as the refresh interval.\n\nWhen called from the CLI application, `indicatrix` will print the supplied text and draw the ellipsis (`.` \u003e `..` \u003e `...` \u003e `.`) animation at the end, until the promise is resolved.\n\n__\u003ca name=\"type-options\"\u003e`Options`\u003c/a\u003e__: The optional options for the indicator, such as the refresh interval.\n\n\n|   Name   |                                   Type                                    |                             Description                              |     Default      |\n| -------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------- | ---------------- |\n| interval | \u003cem\u003enumber\u003c/em\u003e                                                           | The interval with which to update the screen.                        | `250`            |\n| writable | \u003cem\u003e!(NodeJS.WriteStream \\| [stream.Writable](#type-streamwritable))\u003c/em\u003e | The writable stream used for printing data with the `.write` method. | `process.stdout` |\n\n```js\nimport indicatrix from 'indicatrix'\n\n(async () =\u003e {\n  const res = await indicatrix('Please wait', async () =\u003e {\n    await new Promise(r =\u003e setTimeout(r, 750))\n    return 'OK'\n  }, { interval: 100 })\n  console.log(res)\n})()\n```\n```\nPlease wait.\nPlease wait..\nPlease wait...\nPlease wait\nPlease wait.\nPlease wait..\nPlease wait...\nPlease wait\n```\n```\nOK            \n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/3.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e\n\n## `INDICATRIX_PLACEHOLDER` env\n\nWhen the `INDICATRIX_PLACEHOLDER` is set to anything other than `0`, the package won't print the `...` ellipsis, but append the static `\u003cINDICATRIX_PLACEHOLDER\u003e` string to the loading text instead. This is used by [documentary](https://artdecocode.com/documentary/) to add an interactive placeholder:\n\n\u003cpre\u003ePlease wait\u003ca id=\"_ind0\" href=\"#_ind0\"\u003e\u003cimg src=\".documentary/indicatrix.gif\"\u003e\u003c/a\u003e\nOK\u003c/pre\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/4.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e\n\n## Copyright\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003e\n      \u003ca href=\"https://www.artd.eco\"\u003e\n        \u003cimg width=\"100\" src=\"https://raw.githubusercontent.com/wrote/wrote/master/images/artdeco.png\"\n          alt=\"Art Deco\"\u003e\n      \u003c/a\u003e\n    \u003c/th\u003e\n    \u003cth\u003e© \u003ca href=\"https://www.artd.eco\"\u003eArt Deco™\u003c/a\u003e   2020\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/-1.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartdecocode%2Findicatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartdecocode%2Findicatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartdecocode%2Findicatrix/lists"}