{"_id":"ora-cjs","_rev":"1-7f3431ea872c26d49b35caa5aeb16cd9","name":"ora-cjs","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"ora-cjs","version":"0.0.1","description":"Elegant terminal spinner (cjs version)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/ora.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"scripts":{"test":"xo && ava && tsd","build":"rimraf dist && tsup src/index.ts --dts --format cjs","dev":"rimraf dist && tsup src/index.ts --dts --format cjs --watch"},"keywords":["cli","spinner","spinners","terminal","term","console","ascii","unicode","loading","indicator","progress","busy","wait","idle"],"dependencies":{"chalk":"^5.2.0","cli-cursor":"^4.0.0","cli-spinners":"^2.9.0","is-interactive":"^2.0.0","is-unicode-supported":"^1.3.0","log-symbols":"^5.1.0","stdin-discarder":"^0.1.0","strip-ansi":"^7.0.1","wcwidth":"^1.0.1"},"devDependencies":{"@types/node":"^20.1.4","@types/wcwidth":"^1.0.0","ava":"^5.2.0","get-stream":"^6.0.1","rimraf":"^5.0.1","transform-tty":"^1.0.11","tsd":"^0.28.1","tsup":"^6.7.0","typescript":"^5.1.3","xo":"^0.54.2"},"xo":{"rules":{"@typescript-eslint/no-redundant-type-constituents":"off"}},"gitHead":"7c50f618a970ea6a327e12788fd3d580fddd0f6b","bugs":{"url":"https://github.com/sindresorhus/ora/issues"},"homepage":"https://github.com/sindresorhus/ora#readme","_id":"ora-cjs@0.0.1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-D/K43IjST9ZmsskcoCLCtjSiUXv9lpGrMDheVCQ9GKLGeZRx5++NkllnLbIRzWl4Cb16lRbf8pYd3C87+DHwVQ==","shasum":"523e3034d1af3c5dacb916868bb4e4142088cd6f","tarball":"https://registry.npmjs.org/ora-cjs/-/ora-cjs-0.0.1.tgz","fileCount":6,"unpackedSize":50076,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0x1AFicJmYR6c8p6OgzOmC93gzAhrpp4FsxJmIiHodwIhAN8hqnvVTVDA5O0Tc++zE0J0KoKPFZGmkndBDV2lT3XM"}]},"_npmUser":{"name":"wighawag","email":"npmdev1234567890@gmail.com"},"directories":{},"maintainers":[{"name":"wighawag","email":"npmdev1234567890@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ora-cjs_0.0.1_1686473545109_0.6375136202962208"},"_hasShrinkwrap":false},"0.0.2":{"name":"ora-cjs","version":"0.0.2","description":"Elegant terminal spinner (cjs version)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/ora.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"scripts":{"test":"xo && ava && tsd","build":"rimraf dist && tsup src/index.ts --dts --format cjs","dev":"rimraf dist && tsup src/index.ts --dts --format cjs --watch"},"keywords":["cli","spinner","spinners","terminal","term","console","ascii","unicode","loading","indicator","progress","busy","wait","idle"],"dependencies":{"chalk":"^4.1.2","cli-cursor":"^4.0.0","cli-spinners":"^2.9.0","is-interactive":"^2.0.0","is-unicode-supported":"^1.3.0","log-symbols":"^5.1.0","stdin-discarder":"^0.1.0","strip-ansi":"^7.0.1","wcwidth":"^1.0.1"},"devDependencies":{"@types/node":"^20.1.4","@types/wcwidth":"^1.0.0","ava":"^5.2.0","get-stream":"^6.0.1","rimraf":"^5.0.1","transform-tty":"^1.0.11","tsd":"^0.28.1","tsup":"^6.7.0","typescript":"^5.1.3","xo":"^0.54.2"},"xo":{"rules":{"@typescript-eslint/no-redundant-type-constituents":"off"}},"gitHead":"ce7884bbd2382507ce99d550dd19ee68826ca3bc","bugs":{"url":"https://github.com/sindresorhus/ora/issues"},"homepage":"https://github.com/sindresorhus/ora#readme","_id":"ora-cjs@0.0.2","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-GBBLn5PJ+d0eUDpa6KTxv/j7jXufuFPR+q58BI9H7nCCm/aH+BxyBB6wpr+G2PxmKYIdoGyGg0fqf2ys2qeUYQ==","shasum":"a8d1ad1528b87694ba128e4cce5e6c1e726f38ed","tarball":"https://registry.npmjs.org/ora-cjs/-/ora-cjs-0.0.2.tgz","fileCount":6,"unpackedSize":50076,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDltI+Y87JB85d/vcULg8qz1fDM9RoyNFqLue+omtZ3twIgMTgzSwHqU/Gn4/Q/WMWlKqPHrNA7JxDeefVsHTH6Ya0="}]},"_npmUser":{"name":"wighawag","email":"npmdev1234567890@gmail.com"},"directories":{},"maintainers":[{"name":"wighawag","email":"npmdev1234567890@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ora-cjs_0.0.2_1686474148470_0.24219526037765537"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-11T08:52:25.108Z","0.0.1":"2023-06-11T08:52:25.257Z","modified":"2023-06-11T09:02:28.799Z","0.0.2":"2023-06-11T09:02:28.678Z"},"maintainers":[{"name":"wighawag","email":"npmdev1234567890@gmail.com"}],"description":"Elegant terminal spinner (cjs version)","homepage":"https://github.com/sindresorhus/ora#readme","keywords":["cli","spinner","spinners","terminal","term","console","ascii","unicode","loading","indicator","progress","busy","wait","idle"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/ora.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/ora/issues"},"license":"MIT","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## 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\nText to display after 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\nName of one of the [provided spinners](#spinners). See `example.js` in this repo if you want to test out different spinners. On Windows, 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\tinterval: 80, // Optional\n\tframes: ['-', '+', '-']\n}\n```\n\n##### color\n\nType: `string`\\\nDefault: `'cyan'`\\\nValues: `'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray'`\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 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 of 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`\\\nDefault: Current `prefixText`\n\nText to be persisted before the symbol. No prefix text will be displayed if set to an empty string.\n\n###### suffixText\n\nType: `string`\\\nDefault: Current `suffixText`\n\nText 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):\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 synchronous operations blocks the thread, including the spinner animation. Prefer asynchronous operations whenever possible.\n\n## Related\n\n- [cli-spinners](https://github.com/sindresorhus/cli-spinners) - Spinners for use in the terminal\n- [listr](https://github.com/SamVerschueren/listr) - Terminal task list\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- [spinnies](https://github.com/jcarpanelli/spinnies) - Terminal multi-spinner library for Node.js\n- [kia](https://github.com/HarryPeach/kia) - Simple terminal spinners for Deno 🦕\n","readmeFilename":"readme.md"}