{"_id":"@trufflesuite/spinnies","_rev":"4670388","name":"@trufflesuite/spinnies","description":"Create and manage multiple spinners in command-line interface programs","dist-tags":{"latest":"0.1.1"},"maintainers":[{"name":"cds-amal","email":""},{"name":"davidmurdoch","email":"david@davidmurdoch.com"},{"name":"jeff.smale","email":""},{"name":"rizedr","email":""}],"time":{"modified":"2026-04-10T23:02:55.000Z","created":"2022-04-13T04:32:05.416Z","0.1.1":"2022-08-05T04:45:38.394Z","0.1.0":"2022-04-13T04:32:05.416Z"},"users":{},"repository":{"type":"git","url":"git+ssh://git@github.com/trufflesuite/spinnies.git"},"versions":{"0.1.1":{"name":"@trufflesuite/spinnies","version":"0.1.1","description":"Create and manage multiple spinners in command-line interface programs","main":"index.js","scripts":{"test":"npx mocha test"},"types":"index.d.ts","keywords":["node","nodejs","node.js","multiple","multi","multispinner","spinner","spinners","loadre","loading","loading-bar","cli","console","command-line","command","terminal"],"contributors":[{"name":"Juan Bautista Carpanelli","email":"juanbanelli@gmail.com","url":"https://github.com/jcarpanelli"},{"name":"Ben Burns","url":"https://github.com/benjamincburns"}],"repository":{"type":"git","url":"git+ssh://git@github.com/trufflesuite/spinnies.git"},"bugs":{"url":"https://github.com/trufflesuite/spinnies/issues"},"homepage":"https://github.com/trufflesuite/spinnies#readme","license":"MIT","dependencies":{"chalk":"^4.1.2","cli-cursor":"^3.1.0","strip-ansi":"^6.0.0"},"devDependencies":{"chai":"^4.3.6","mocha":"^9.2.2"},"gitHead":"b43630fca436619f54e196a95a3ebf1743100f7d","_id":"@trufflesuite/spinnies@0.1.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"shasum":"719230993f55ab39f936ed8778979e7661af188d","size":12189,"noattachment":false,"key":"/@trufflesuite/spinnies/-/@trufflesuite/spinnies-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@trufflesuite/spinnies/download/@trufflesuite/spinnies-0.1.1.tgz"},"_npmUser":{"name":"benjamincburns","email":"benjamin.c.burns@gmail.com"},"directories":{},"maintainers":[{"name":"cds-amal","email":""},{"name":"davidmurdoch","email":"david@davidmurdoch.com"},{"name":"jeff.smale","email":""},{"name":"rizedr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spinnies_0.1.1_1659674738190_0.9992463323646075"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-08-05T04:45:45.454Z","publish_time":1659674738394,"_cnpm_publish_time":1659674738394},"0.1.0":{"name":"@trufflesuite/spinnies","version":"0.1.0","description":"Create and manage multiple spinners in command-line interface programs","main":"index.js","scripts":{"test":"npx mocha test"},"types":"index.d.ts","keywords":["node","nodejs","node.js","multiple","multi","multispinner","spinner","spinners","loadre","loading","loading-bar","cli","console","command-line","command","terminal"],"contributors":[{"name":"Juan Bautista Carpanelli","email":"juanbanelli@gmail.com","url":"https://github.com/jcarpanelli"},{"name":"Ben Burns","url":"https://github.com/benjamincburns"}],"repository":{"type":"git","url":"git+ssh://git@github.com/trufflesuite/spinnies.git"},"bugs":{"url":"https://github.com/trufflesuite/spinnies/issues"},"homepage":"https://github.com/trufflesuite/spinnies#readme","license":"MIT","dependencies":{"chalk":"^4.1.2","cli-cursor":"^3.1.0","strip-ansi":"^6.0.0"},"devDependencies":{"chai":"^4.3.6","mocha":"^9.2.2"},"gitHead":"5e97f11bfd6f80027e35c7dcd347f37b1d89d62e","_id":"@trufflesuite/spinnies@0.1.0","_nodeVersion":"12.22.10","_npmVersion":"6.14.16","dist":{"shasum":"da09ff7c526b563ff6e4d4d86b7884ec00a77be2","size":12730,"noattachment":false,"key":"/@trufflesuite/spinnies/-/@trufflesuite/spinnies-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@trufflesuite/spinnies/download/@trufflesuite/spinnies-0.1.0.tgz"},"_npmUser":{"name":"benjamincburns","email":"benjamin.c.burns@gmail.com"},"directories":{},"maintainers":[{"name":"cds-amal","email":""},{"name":"davidmurdoch","email":"david@davidmurdoch.com"},{"name":"jeff.smale","email":""},{"name":"rizedr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spinnies_0.1.0_1649824325282_0.7935877089797341"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-13T04:32:12.586Z","publish_time":1649824325416,"_cnpm_publish_time":1649824325416}},"readme":"# ![spin](https://i.ibb.co/4M0J13j/spin.png) Spinnies ![spin](https://i.ibb.co/4M0J13j/spin.png)\n> Maintained by the Truffle team, originally forked from\n> [jcarpanelli/spinnies](https://github.com/jcarpanelli/spinnies)\n\n> Node.js module to create and manage multiple spinners in command-line interface programs\n\n\n[![npm](https://img.shields.io/npm/v/spinnies.svg)](https://www.npmjs.com/package/@trufflesuite/spinnies)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n<p align=\"center\"> <br> <img src='https://s3.us-west-2.amazonaws.com/jcarpanelli/termtosvg_zb90005u.svg' title='' /> </p>\n\n\n## Installation\n\n```\n$ npm i spinnies\n```\n\n## Usage & Example\n\n```js\nconst spinnies = new Spinnies();\n\nspinnies.add('spinner-1', { text: 'I am a spinner' });\nspinnies.add('spinner-2', { text: 'I am another spinner' });\n\nsetTimeout(() => {\n  spinnies.succeed('spinner-1', { text: 'Success!' });\n  spinnies.fail('spinner-2', { text: 'Fail :(' });\n}, 2000);\n```\n\n## API\n\nThis library follows a **non-error-throwing** philosophy. If you provide an invalid option or an invalid value for a valid option *it will be ignored*.\n\n### Initialization:\n\n#### new Spinnies([options])\n\nParameters\n- **options** - `object`:\n  - **color** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors). The default value is `white`.\n  - **succeedColor** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors). The default value is `green`.\n  - **failColor** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors). The default value is `red`.\n  - **spinnerColor** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors). The default value is `greenBright`.\n  - **succeedPrefix** - `string`: The default value is ✓.\n  - **failPrefix**- `string`: The default value is ✖.\n  - **spinner**- `object`:\n    - **interval** - `number`\n    - **frames** - `string[]`\n\n    You can see the already provided spinner [here](https://github.com/jcarpanelli/spinnies/blob/master/spinners.json).\n  - **disableSpins** - `boolean`: Disable spins (will still print raw messages).\n\n*Note: If you are working in any `win32` platform, the default spin animation will be overriden. You can get rid of this defining a different spinner animation manually, or by using the integrated VSCode terminal or Windows Terminal.*\n\nExample:\n\n```js\nconst spinner = { interval: 80, frames: ['????', '????', '????', '????'] }\nconst spinnies = new Spinnies({ color: 'blue', succeedColor: 'green', spinner });\n```\n\n### Instance methods:\n\n#### add(name, [options])\n\nAdds a new spinner with the given name.\n\nParameters:\n- **name** - `string`: spinner reference name.\n- **options** - `object`:\n  - **text**: - `string`: Optional text to show in the spinner. If none is provided, the `name` field will be shown.\n  - **indent**: - `number`: Optional, indent the spinner with the given number of spaces.\n  - **status** - `string`: Initial status of the spinner. Valid statuses are: `succeed`, `fail`, `spinning`, `non-spinnable`and `stopped`.\n  - **color** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors).\n  - **succeedColor** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors).\n  - **failColor** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors).\n\nReturn value: Returns the spinner's options.\n\nExample:\n\n```js\nconst spinnies = new Spinnies();\nspinnies.add('spinner-1');\nspinnies.add('another-spinner', { text: 'Hello, I am a spinner!', color: 'greenBright' });\n\n```\n\n#### pick(name)\nPicks a spinner.\n\nParameters:\n- **name** - `string`: spinner reference name.\n\nReturn value: Returns the spinner's options.\n\n#### remove(name)\nRemoves a spinner.\n\nParameters:\n- **name** - `string`: spinner reference name.\n\nReturn value: Returns the spinner's options.\n\n#### update(name, [options])\n\nUpdates the spinner with name `name` with the provided options.\n\nParameters:\n- **name** - `string`: spinner reference name.\n- **options** - `object`:\n  - **text**: - `string`: Optional text to show in the spinner. If none is provided, the `name` field will be shown.\n  - **status** - `string`: New status of the spinner. Valid statuses are: `succeed`, `fail`, `spinning`, `non-spinnable`and `stopped`.\n  - **color** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors).\n  - **succeedColor** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors).\n  - **failColor** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors).\n\nReturn value: Returns the spinner's options.\n\nExample:\n\n```js\nconst spinnies = new Spinnies();\nspinnies.add('spinner-1', { text: 'Hello! I am the initial text', color: 'green' });\n// some code\nspinnies.update('spinner-1', { text: 'Hello, I am an updated text!', color: 'blue' });\n\n```\n\n#### succeed(name, [options])\n\nSets the specified spinner status as `succeed`.\n\nParameters:\n- **name** - `string`: spinner reference name.\n- **options** - `object`:\n  - **text**: - `string`: Optional text to show in the spinner. If none is provided, the `name` field will be shown.\n  - **succeedColor** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors).\n\nReturn value: Returns the spinner's options.\n\nExample:\n\n```js\nconst spinnies = new Spinnies();\nspinnies.add('spinner-1', { text: 'Hello! I am the initial text', color: 'green' });\n// some code\nspinnies.succeed('spinner-1', { text: 'Success!', successColor: 'greenBright' });\n\n```\n\n#### fail(name, [options])\n\nSets the specified spinner status as `fail`.\n\nParameters:\n- **name** - `string`: spinner reference name.\n- **options** - `object`:\n  - **text**: - `string`: Optional text to show in the spinner. If none is provided, the `name` field will be shown.\n  - **failColor** - `string`: Any valid [chalk color](https://github.com/chalk/chalk#colors).\n\nReturn value: Returns the spinner's options.\n\nExample:\n\n```js\nconst spinnies = new Spinnies();\nspinnies.add('spinner-1', { text: 'Hello! I am the initial text', color: 'green' });\n// some code\nspinnies.fail('spinner-1', { text: 'I failed', failColor: 'redBright' });\n\n```\n\n#### stopAll([status])\n\nStops the spinners and sets the non-succeeded and non-failed ones to the provided status, which can be `succeed`, `fail` or `stopped`. You can see an example [here](https://github.com/jcarpanelli/spinnies/blob/master/examples/demo-stop-all.js).\n\n#### hasActiveSpinners()\nReturn value: returns `false` if all spinners have succeeded, failed or have been stopped.\n\n\n## Contribute\n\nStar it, fork it, improve it, PR it! :raised_hands:.\n\n\n## Acknowledgements\n\nThanks to [chalk](https://github.com/chalk/chalk) for helping making this lib colorful :rainbow: and to [ora](https://github.com/sindresorhus/ora) which was a great inspiration :unicorn:.\n\n## License\n\n[MIT](https://github.com/jcarpanelli/spinnies/blob/master/LICENSE)\n","_attachments":{},"homepage":"https://github.com/trufflesuite/spinnies#readme","bugs":{"url":"https://github.com/trufflesuite/spinnies/issues"},"license":"MIT"}