{"name":"spinnies","version":"0.3.1","description":"Create and manage multiple spinners in command-line interface programs","main":"index.js","scripts":{"test":"npx mocha test"},"keywords":["node","nodejs","node.js","multiple","multi","multispinner","spinner","spinners","loadre","loading","loading-bar","cli","console","command-line","command","terminal"],"author":{"name":"Juan Bautista Carpanelli","email":"juanbanelli@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/jcarpanelli/spinnies.git"},"bugs":{"url":"https://github.com/jcarpanelli/spinnies/issues"},"homepage":"https://github.com/jcarpanelli/spinnies#readme","license":"MIT","dependencies":{"chalk":"^2.4.2","cli-cursor":"^3.0.0"},"devDependencies":{"chai":"^4.2.0","mocha":"^6.1.4"},"gitHead":"ac442f68d35c2f1629d2319f792ec23185faea2b","_id":"spinnies@0.3.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"jcarpanelli","email":"juanbanelli@gmail.com"},"dist":{"integrity":"sha512-bj9fG76S+9GyPxCkLsyFzbhHpfv0oo+WIjPd4t2PiqAOFOaAn8Kn5wMrEeIvYcLs8jKrf6D0kAr1k+JSSPr4tQ==","shasum":"0ff2e8a9868e6f4f5f490bb3a9d498b08dab8b3b","tarball":"http://registry-npm.ywwl.com/spinnies/download/spinnies-0.3.1.tgz","fileCount":12,"unpackedSize":33064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8v8vCRA9TVsSAnZWagAAf9cP/2zg2p/9ESo8vONE+AIl\n2jLBFD3DqoYqtAGxJhA1LUhVWOcUkxLgNg0qNRNVn7UvhsAjZCSylRxPljYP\nsr6r1KczAT/Y2raJX1dVELgDtP7aSPm5fMRY3H0ygigLRT1/8LnkjSwSB2C8\ncMBzu1MH1GosfK4gNIMwytnQX6UWdmacPh6MZ7Pe8rqnvjLys4/zZugil9a+\nUvKMVXWr9T5rK+i8jcvTA1eaqiW7PGpDihEvK2nWJFHQyN8W2zLc3Lla1S57\nmNNrvkqXlMzTBsPmFcizkDMyvbvJilTLysqJVI358ErBSZCze9O+ZHVbgx6f\nUo++/K821sP75Tlz9N9hqY0G/oPD/Uxavl9NkrRH/1DVozXUcfHFEn/wGtfc\nnmTq6rrGgKZNUwee/hZVxvcPMmrF+4R0dWXrNTtFwE10yxrdJHTFZscKy4GS\nsF/be91xI3n2L+ppw8bfbwoMcQIvOEYhLj1G8OEa/Lo6N/JSzhtRiD30CiEO\nMCmd9xOQ8kfHYtu7Ceo4CboXAZ39yuksFkpi/3mdgR/ZxWanS8JpHRQMGec/\npv9X90Q9IDW/JADcsMqYw5T6fFKh+4Kl2N5Agl83ngoFlM/VUSbT/+AUTr/1\nUmXzWxfXdWAItSYbnG4burgQxgUNNZTSmlYCd3Liwur0+blt99hRgiHsOz2A\nJ8O+\r\n=11nv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB668SxlrOYrYQDTQccA6wdlJDebwaDsdxj8bdEcIVlJAiEAqZjBpmwtNnrQiglGkP5wX5E6VAlYEblKDA9Cm4Jz3J8="}],"size":8255,"noattachment":false,"key":"/spinnies/-/spinnies-0.3.1.tgz"},"maintainers":[{"name":"jcarpanelli","email":"juanbanelli@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spinnies_0.3.1_1559428910229_0.8031949997987267"},"_hasShrinkwrap":false,"readme":"# ![spin](https://i.ibb.co/4M0J13j/spin.png) Spinnies ![spin](https://i.ibb.co/4M0J13j/spin.png)\n> Node.js module to create and manage multiple spinners in command-line interface programs\n\n[![npm](https://img.shields.io/npm/v/spinnies.svg)](https://www.npmjs.com/package/spinnies)\n[![CircleCI](https://circleci.com/gh/jcarpanelli/spinnies.svg?style=shield)](https://circleci.com/gh/jcarpanelli/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","publish_time":1559428910341,"_cnpm_publish_time":1559428910341,"dist-tags":{"latest":"0.5.1"}}