You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Name of one of the provided spinners. See [`example.js`](https://github.com/BendingBender/ora/blob/main/example.js) in this repo if you want to test out different spinners. On Windows, it will always use the line spinner as the Windows command-line doesn't have proper Unicode support.
40
+
The name of one of the provided spinners. See [`example.js`](https://github.com/BendingBender/ora/blob/main/example.js) in this repo if you want to test out different spinners. On Windows (expect for Windows Terminal), it will always use the line spinner as the Windows command-line doesn't have proper Unicode support.
41
41
42
42
@default 'dots'
43
43
@@ -46,8 +46,8 @@ export type Options = {
46
46
@example
47
47
```
48
48
{
49
-
interval: 80, // Optional
50
-
frames: ['-', '+', '-']
49
+
frames: ['-', '+', '-'],
50
+
interval: 80 // Optional
51
51
}
52
52
```
53
53
*/
@@ -204,7 +204,7 @@ export interface Ora {
204
204
setspinner(spinner: SpinnerName|Spinner);
205
205
206
206
/**
207
-
A boolean of whether the instance is currently spinning.
207
+
A boolean indicating whether the instance is currently spinning.
Name of one of the [provided spinners](#spinners). See `example.js` in this repo if you want to test out different spinners. On Windows, it will always use the `line` spinner as the Windows command-line doesn't have proper Unicode support.
66
+
The name of one of the [provided spinners](#spinners). See `example.js` in this repo if you want to test out different spinners. On Windows (except for Windows Terminal), it will always use the `line` spinner as the Windows command-line doesn't have proper Unicode support.
65
67
66
68
Or an object like:
67
69
68
70
```js
69
71
{
70
-
interval:80, // Optional
71
-
frames: ['-', '+', '-']
72
+
frames: ['-', '+', '-'],
73
+
interval:80// Optional
72
74
}
73
75
```
74
76
@@ -140,7 +142,7 @@ This has no effect on Windows as there is no good way to implement discarding st
140
142
141
143
#### .text <sup>get/set</sup>
142
144
143
-
Change the text after the spinner.
145
+
Change the text displayed after the spinner.
144
146
145
147
#### .prefixText <sup>get/set</sup>
146
148
@@ -168,7 +170,7 @@ Change the spinner indent.
168
170
169
171
#### .isSpinning <sup>get</sup>
170
172
171
-
A boolean of whether the instance is currently spinning.
173
+
A boolean indicating whether the instance is currently spinning.
172
174
173
175
#### .interval <sup>get</sup>
174
176
@@ -224,17 +226,17 @@ Text to be persisted after the symbol.
224
226
225
227
###### prefixText
226
228
227
-
Type: `string`\
229
+
Type: `string | () => string`\
228
230
Default: Current `prefixText`
229
231
230
-
Text to be persisted before the symbol. No prefix text will be displayed if set to an empty string.
232
+
Text or a function that returns text to be persisted before the symbol. No prefix text will be displayed if set to an empty string.
231
233
232
234
###### suffixText
233
235
234
-
Type: `string`\
236
+
Type: `string | () => string`\
235
237
Default: Current `suffixText`
236
238
237
-
Text to be persisted after the text after the symbol. No suffix text will be displayed if set to an empty string.
239
+
Text or a function that returns text to be persisted after the text after the symbol. No suffix text will be displayed if set to an empty string.
238
240
239
241
<imgsrc="screenshot-2.gif"width="480">
240
242
@@ -297,7 +299,7 @@ All [provided spinners](https://github.com/sindresorhus/cli-spinners/blob/main/s
297
299
298
300
### How do I change the color of the text?
299
301
300
-
Use [Chalk](https://github.com/chalk/chalk):
302
+
Use [`chalk`](https://github.com/chalk/chalk) or [`yoctocolors`](https://github.com/sindresorhus/yoctocolors):
JavaScript is single-threaded, so synchronous operations blocks the thread, including the spinner animation. Prefer asynchronous operations whenever possible.
313
+
JavaScript is single-threaded, so any synchronous operations will block the spinner's animation. To avoid this, prefer using asynchronous operations.
0 commit comments