{"_id":"@aigne/ora","_rev":"3-c5c5e235d0347a4ca525eda65f7bf97a","name":"@aigne/ora","dist-tags":{"latest":"8.2.0"},"versions":{"8.2.0":{"name":"@aigne/ora","version":"8.2.0","keywords":["cli","spinner","spinners","terminal","term","console","ascii","unicode","loading","indicator","progress","busy","wait","idle"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"@aigne/ora@8.2.0","maintainers":[{"name":"li-yechao","email":"liyechao@yechao.xyz"},{"name":"wangshijun","email":"shijun@arcblock.io"}],"homepage":"https://github.com/sindresorhus/ora#readme","bugs":{"url":"https://github.com/sindresorhus/ora/issues"},"dist":{"shasum":"f47c88f7bd435122c25639b0c6abf3420578be71","tarball":"https://registry.npmjs.org/@aigne/ora/-/ora-8.2.0.tgz","fileCount":7,"integrity":"sha512-bgDSIsLsDi8ncOWpI/ycJeZsmvrHS/ZO5Iky8K9wDk+dpke6V1v/kPPYFKnqIAW1MBCn+ZuhlloBnNEQXAl2ZA==","signatures":[{"sig":"MEYCIQDAZ+pKCrsEIbjypN4hoWfOhyJzPDIQof5V8Y/IB0jmsAIhAPejc32XgD8GxMtJd2DhV4VyTJxwP+9NOWGcJAA0RQ6F","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39918},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js","require":"./cjs/index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"79d0339e000cf956ba5581013f27bd86a41d56fc","scripts":{"test":"xo && ava && tsd","build":"tsc --allowJs true --module CommonJs --target EsNext index.js --outDir cjs","postbuild":"echo '{\"type\": \"commonjs\"}' > cjs/package.json","prepublish":"npm run build"},"_npmUser":{"name":"li-yechao","email":"liyechao@yechao.xyz"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://github.com/sindresorhus/ora.git","type":"git"},"_npmVersion":"10.8.2","description":"Elegant terminal spinner","directories":{},"sideEffects":false,"_nodeVersion":"20.19.0","dependencies":{"chalk":"^5.3.0","cli-cursor":"^5.0.0","strip-ansi":"^7.1.0","log-symbols":"^6.0.0","cli-spinners":"^2.9.2","string-width":"^7.2.0","is-interactive":"^2.0.0","stdin-discarder":"^0.2.2","is-unicode-supported":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.59.3","ava":"^5.3.1","tsd":"^0.31.1","get-stream":"^9.0.1","typescript":"^5.8.2","@types/node":"^22.5.0","transform-tty":"^1.0.11"},"_npmOperationalInternal":{"tmp":"tmp/ora_8.2.0_1743424162272_0.14906533451897852","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-03-31T12:29:22.172Z","modified":"2026-01-21T06:21:25.816Z","8.2.0":"2025-03-31T12:29:22.448Z"},"bugs":{"url":"https://github.com/sindresorhus/ora/issues"},"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","homepage":"https://github.com/sindresorhus/ora#readme","keywords":["cli","spinner","spinners","terminal","term","console","ascii","unicode","loading","indicator","progress","busy","wait","idle"],"repository":{"url":"git+https://github.com/sindresorhus/ora.git","type":"git"},"description":"Elegant terminal spinner","maintainers":[{"email":"liyechao@yechao.xyz","name":"li-yechao"},{"email":"shijun@arcblock.io","name":"wangshijun"},{"email":"rob@arcblock.io","name":"mave99a"}],"readme":"# ora\n\n> Elegant terminal spinner\n\n<p align=\"center\">\n\t<br>\n\t<img src=\"screenshot.svg\" width=\"500\">\n\t<br>\n</p>\n\n## Install\n\n```sh\nnpm install ora\n```\n\n*Check out [`yocto-spinner`](https://github.com/sindresorhus/yocto-spinner) for a smaller alternative.*\n\n## Usage\n\n```js\nimport ora from 'ora';\n\nconst spinner = ora('Loading unicorns').start();\n\nsetTimeout(() => {\n\tspinner.color = 'yellow';\n\tspinner.text = 'Loading rainbows';\n}, 1000);\n```\n\n## API\n\n### ora(text)\n### ora(options)\n\nIf a string is provided, it is treated as a shortcut for [`options.text`](#text).\n\n#### options\n\nType: `object`\n\n##### text\n\nType: `string`\n\nThe text to display next to the spinner.\n\n##### prefixText\n\nType: `string | () => string`\n\nText or a function that returns text to display before the spinner. No prefix text will be displayed if set to an empty string.\n\n##### suffixText\n\nType: `string | () => string`\n\nText or a function that returns text to display after the spinner text. No suffix text will be displayed if set to an empty string.\n\n##### spinner\n\nType: `string | object`\\\nDefault: `'dots'` <img src=\"screenshot-spinner.gif\" width=\"14\">\n\nThe name of one of the [provided spinners](#spinners). See `example.js` in this repo if you want to test out different spinners. On Windows (except for Windows Terminal), it will always use the `line` spinner as the Windows command-line doesn't have proper Unicode support.\n\nOr an object like:\n\n```js\n{\n\tframes: ['-', '+', '-'],\n\tinterval: 80 // Optional\n}\n```\n\n##### color\n\nType: `string | boolean`\\\nDefault: `'cyan'`\\\nValues: `'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray' | boolean`\n\nThe color of the spinner.\n\n##### hideCursor\n\nType: `boolean`\\\nDefault: `true`\n\nSet to `false` to stop Ora from hiding the cursor.\n\n##### indent\n\nType: `number`\\\nDefault: `0`\n\nIndent the spinner with the given number of spaces.\n\n##### interval\n\nType: `number`\\\nDefault: Provided by the spinner or `100`\n\nInterval between each frame.\n\nSpinners provide their own recommended interval, so you don't really need to specify this.\n\n##### stream\n\nType: `stream.Writable`\\\nDefault: `process.stderr`\n\nStream to write the output.\n\nYou could for example set this to `process.stdout` instead.\n\n##### isEnabled\n\nType: `boolean`\n\nForce enable/disable the spinner. If not specified, the spinner will be enabled if the `stream` is being run inside a TTY context (not spawned or piped) and/or not in a CI environment.\n\nNote that `{isEnabled: false}` doesn't mean it won't output anything. It just means it won't output the spinner, colors, and other ansi escape codes. It will still log text.\n\n##### isSilent\n\nType: `boolean`\\\nDefault: `false`\n\nDisable the spinner and all log text. All output is suppressed and `isEnabled` will be considered `false`.\n\n##### discardStdin\n\nType: `boolean`\\\nDefault: `true`\n\nDiscard stdin input (except Ctrl+C) while running if it's TTY. This prevents the spinner from twitching on input, outputting broken lines on <kbd>Enter</kbd> key presses, and prevents buffering of input while the spinner is running.\n\nThis has no effect on Windows as there is no good way to implement discarding stdin properly there.\n\n### Instance\n\n#### .text <sup>get/set</sup>\n\nChange the text displayed after the spinner.\n\n#### .prefixText <sup>get/set</sup>\n\nChange the text before the spinner.\n\nNo prefix text will be displayed if set to an empty string.\n\n#### .suffixText <sup>get/set</sup>\n\nChange the text after the spinner text.\n\nNo suffix text will be displayed if set to an empty string.\n\n#### .color <sup>get/set</sup>\n\nChange the spinner color.\n\n#### .spinner <sup>get/set</sup>\n\nChange the spinner.\n\n#### .indent <sup>get/set</sup>\n\nChange the spinner indent.\n\n#### .isSpinning <sup>get</sup>\n\nA boolean indicating whether the instance is currently spinning.\n\n#### .interval <sup>get</sup>\n\nThe interval between each frame.\n\nThe interval is decided by the chosen spinner.\n\n#### .start(text?)\n\nStart the spinner. Returns the instance. Set the current text if `text` is provided.\n\n#### .stop()\n\nStop and clear the spinner. Returns the instance.\n\n#### .succeed(text?)\n\nStop the spinner, change it to a green `✔` and persist the current text, or `text` if provided. Returns the instance. See the GIF below.\n\n#### .fail(text?)\n\nStop the spinner, change it to a red `✖` and persist the current text, or `text` if provided. Returns the instance. See the GIF below.\n\n#### .warn(text?)\n\nStop the spinner, change it to a yellow `⚠` and persist the current text, or `text` if provided. Returns the instance.\n\n#### .info(text?)\n\nStop the spinner, change it to a blue `ℹ` and persist the current text, or `text` if provided. Returns the instance.\n\n#### .stopAndPersist(options?)\n\nStop the spinner and change the symbol or text. Returns the instance. See the GIF below.\n\n##### options\n\nType: `object`\n\n###### symbol\n\nType: `string`\\\nDefault: `' '`\n\nSymbol to replace the spinner with.\n\n###### text\n\nType: `string`\\\nDefault: Current `'text'`\n\nText to be persisted after the symbol.\n\n###### prefixText\n\nType: `string | () => string`\\\nDefault: Current `prefixText`\n\nText or a function that returns text to be persisted before the symbol. No prefix text will be displayed if set to an empty string.\n\n###### suffixText\n\nType: `string | () => string`\\\nDefault: Current `suffixText`\n\nText or a function that returns text to be persisted after the text after the symbol. No suffix text will be displayed if set to an empty string.\n\n<img src=\"screenshot-2.gif\" width=\"480\">\n\n#### .clear()\n\nClear the spinner. Returns the instance.\n\n#### .render()\n\nManually render a new frame. Returns the instance.\n\n#### .frame()\n\nGet a new frame.\n\n### oraPromise(action, text)\n### oraPromise(action, options)\n\nStarts a spinner for a promise or promise-returning function. The spinner is stopped with `.succeed()` if the promise fulfills or with `.fail()` if it rejects. Returns the promise.\n\n```js\nimport {oraPromise} from 'ora';\n\nawait oraPromise(somePromise);\n```\n\n#### action\n\nType: `Promise | ((spinner: ora.Ora) => Promise)`\n\n#### options\n\nType: `object`\n\nAll of the [options](#options) plus the following:\n\n##### successText\n\nType: `string | ((result: T) => string) | undefined`\n\nThe new text of the spinner when the promise is resolved.\n\nKeeps the existing text if `undefined`.\n\n##### failText\n\nType: `string | ((error: Error) => string) | undefined`\n\nThe new text of the spinner when the promise is rejected.\n\nKeeps the existing text if `undefined`.\n\n### spinners\n\nType: `Record<string, Spinner>`\n\nAll [provided spinners](https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json).\n\n## FAQ\n\n### How do I change the color of the text?\n\nUse [`chalk`](https://github.com/chalk/chalk) or [`yoctocolors`](https://github.com/sindresorhus/yoctocolors):\n\n```js\nimport ora from 'ora';\nimport chalk from 'chalk';\n\nconst spinner = ora(`Loading ${chalk.red('unicorns')}`).start();\n```\n\n### Why does the spinner freeze?\n\nJavaScript is single-threaded, so any synchronous operations will block the spinner's animation. To avoid this, prefer using asynchronous operations.\n\n## Related\n\n- [yocto-spinner](https://github.com/sindresorhus/yocto-spinner) - Tiny terminal spinner\n- [cli-spinners](https://github.com/sindresorhus/cli-spinners) - Spinners for use in the terminal\n\n**Ports**\n\n- [CLISpinner](https://github.com/kiliankoe/CLISpinner) - Terminal spinner library for Swift\n- [halo](https://github.com/ManrajGrover/halo) - Python port\n- [spinners](https://github.com/FGRibreau/spinners) - Terminal spinners for Rust\n- [marquee-ora](https://github.com/joeycozza/marquee-ora) - Scrolling marquee spinner for Ora\n- [briandowns/spinner](https://github.com/briandowns/spinner) - Terminal spinner/progress indicator for Go\n- [tj/go-spin](https://github.com/tj/go-spin) - Terminal spinner package for Go\n- [observablehq.com/@victordidenko/ora](https://observablehq.com/@victordidenko/ora) - Ora port to Observable notebooks\n- [kia](https://github.com/HarryPeach/kia) - Simple terminal spinners for Deno 🦕\n","readmeFilename":"readme.md"}