{"name":"spinnies","version":"0.4.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","strip-ansi":"^5.2.0"},"devDependencies":{"chai":"^4.2.0","mocha":"^6.1.4"},"gitHead":"5f5eee8a481197561cc6302bb8c4076cdfdd13d2","_id":"spinnies@0.4.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ar/rOs4R6k+UGkdZ89eVwtWYK/OJsDbdjt4Fg/3YdEJBqp8xs8UjqP7juAppjSnL0XaHM3HWXgMzjvo8L2auWA==","shasum":"84b87ebf1e68678c3c359a8e0349dda088bb744a","tarball":"http://registry-npm.ywwl.com/spinnies/download/spinnies-0.4.1.tgz","fileCount":13,"unpackedSize":37300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCQ1BCRA9TVsSAnZWagAA9OQP/3T/rZhNhuQMvttyIOUq\nWHkZDaI4v5qjjQjBRjqQaEuzHcTOHsCTN9kiKZwFn1VRan8MtFsIBP4lCzJ9\nCqBa+fXDjMn2L+aWIlKSdV94kmMO+9lIutQ57qIrkjga9gtPS2RnzTq7BPrg\n84CrQ+gUoR4m1+WW1UG4ScDP7RNq+okRGIJV2jpK4GJqQTD3Geiicy+688Th\n/6nGZnvSFjFHusXCNDGQIJ1vsDM4NOqL72xuEL48ud0MYlMbjzvmHnQgLLI1\nQAGtXhos8cbkdl1FwnU1LUrH1QYji1zns9xPPwAJX8AFTFcthCYDltc9ue+T\nZWQ9GklHH6XAWFoD6i+6NLPpZGkqeGt0gUnYsJKzv72p4QmhNxqJD3kIJ5WJ\nnMhmZInA9bTbC1R3Bnzw5aZ/dtBSk2/F1aDNYbU4vMkpbLtLgmd/ur0pswgI\n41RI5f+R0bu3+4B4X8uJzrK5yD0gtPqhm1w5GLVy4hGfkjr2icG5zdDnU0Bn\ncumSuPSSy7+GWjEawHf6yHgQMOS1NGH9N6lSBeH0pqmhz6RtrLogIh2f154e\ndSqItU5dZ0eJY3uDMnKInVYHrNvniUsoovwxaKfIEQoBu0Ux0gEZomjaNMrF\ncjSCakdlPFl5d60nGjeacwQoIRho7cr6Uncuzdl42DQJMcpV9MKLvB/tNKLv\nw9bS\r\n=oqop\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFph6CQpfOSZP5XjDeVduUekoXRfM89y0YWR65J12gkAIhAMr5LMpvwDUDuorKRZ8j9zz19z+hp3KmluP43D9/8GMp"}],"size":9645,"noattachment":false,"key":"/spinnies/-/spinnies-0.4.1.tgz"},"maintainers":[{"name":"jcarpanelli","email":"juanbanelli@gmail.com"}],"_npmUser":{"name":"jcarpanelli","email":"juanbanelli@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spinnies_0.4.1_1560874305209_0.6431821015650023"},"_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":1560874305381,"_cnpm_publish_time":1560874305381,"dist-tags":{"latest":"0.5.1"}}