-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add random
spinner
#47
Conversation
I usually prefer a method when the return value is not deterministic, but in this case, it could be nice that |
@sindresorhus done! Not sure what's wrong with CI though 😕
|
Can you mention in the API docs in the readme and index.d.ts that the |
Don't worry about that. I'll deal with it. |
Done |
index.d.ts
Outdated
| "grenade" | ||
| "point" | ||
| "layer" | ||
| "betaWave"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do unrelated changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, just noticed them. I'll fix them in a minute!
readme.md
Outdated
@@ -22,7 +22,7 @@ $ npm install cli-spinners | |||
## Usage | |||
|
|||
```js | |||
const cliSpinners = require('cli-spinners'); | |||
const cliSpinners = require("cli-spinners"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Thanks :) |
Summary
I have been developing a CLI for a couple of days now and I think it is kinda fun to have a random spinner every time I use one if its commands.
I created a wrapper of cli-spinners in the CLI and developed this feature just for myself... but maybe other people also like it, so here you go.
Feel free to close the PR if you don't want this feature in the codebase :)
Alternative implementation
Instead of having it as a function
cliSpinners.random()
, we could use something likeObject.defineProperty
to have it as an attributecliSpinners.random