{"name":"spinnies","version":"0.4.0","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","strip-ansi":"^5.2.0"},"devDependencies":{"chai":"^4.2.0","mocha":"^6.1.4"},"gitHead":"71e902ac3c39c3c25a4d78475e37018d1193326a","_id":"spinnies@0.4.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"jcarpanelli","email":"juanbanelli@gmail.com"},"dist":{"integrity":"sha512-NXwjilGR3I0rQFq89Kpzk8VsAy+4pMdzOa2jJnH7qXz8Cytlh5NJ5YaV9HgeKliN2e/pA+jDiinnmThOk5pKeQ==","shasum":"b19f20500421047f44fa7985c67a70f2cacbdc93","tarball":"http://registry-npm.ywwl.com/spinnies/download/spinnies-0.4.0.tgz","fileCount":12,"unpackedSize":34260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBoKaCRA9TVsSAnZWagAA6VQP/izxZrMoCkxtpOQjMhIe\nITzJ++nP5dWKNama28rIQwNcuHFgC4+8deXWlF2FmYZI+12mQQFPlrkilSCG\nVWFYXMu51VZUr9aBNO973u13rZkBm/zJI1sxC3HUAQLMjFBUtVO1eCUl9sWO\nNm8NXcaA4YErOULtWGPdwCd3wic3XUWPIjtBlx6vTSlTFO5S3JidJjc9+hhj\nqYdIxnTOf+NvPn8jl4eGlLPR/SAF3wzG6i5oSBlvLBUK1vlZGbR8hpGNJuml\ne4rESd2/KRZdX+eBt83+iCOqZvmQcfuBHDocl1p24QHhD7RZIM213hhnyYKk\nSVasrWu8SlmXJP3gevsDto/gxv0DIAyq5eMfyNvHmBoJhhwaR5lgjILagxk4\nvrmgDibxsscbHIxSfCxE/BS+XAEbhFzMjbV2npRFgh84ARX4yb3HT9vbnLPK\nYd5Jf45qtx5pZ30YJOwaQHcRYXIOmbX0rmyWAHyUZW4bQRo3AAJys9eMhQ47\no4EDkPbA3lbuuNxXLQjRYq9lr8bZ5jm3vghVSK9PL/qtWnzgSRpsvo3XMgCh\nBSUo1vC5bUPI+LTdoKEx959yNp/ReasrFdm3pcihcawZZFh/TIIVY0Dc3TFV\npcH8jhLUJFP/RE3w2eYE1SXbNey9plDR1zzO29ORyoYaypdPr2hkZHQR7dnm\nZU0i\r\n=GwPC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRKVo9hLPHzeUBYl/7HifnbQxrGF9ERLPH5pF5FoH52gIhAPabogH1GGohj1SAFElX/0Pcxx8Ty4w+XkEtNt2J3jJZ"}],"size":8553,"noattachment":false,"key":"/spinnies/-/spinnies-0.4.0.tgz"},"maintainers":[{"name":"jcarpanelli","email":"juanbanelli@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spinnies_0.4.0_1560707737836_0.6688419971642638"},"_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":1560707737956,"_cnpm_publish_time":1560707737956,"dist-tags":{"latest":"0.5.1"}}