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
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,19 @@ setTimeout(() => {
63
63
64
64
Calling `spinner.stop();` will stop the spinner and remove it.
65
65
66
+
### Output stream
67
+
68
+
Spinners write to `process.stdout` by default. To keep stdout available for machine-readable output, pass another stream such as `process.stderr`:
69
+
70
+
```js
71
+
import {Spinner} from'picospinner';
72
+
73
+
constspinner=newSpinner({
74
+
text:'Loading...',
75
+
stream:process.stderr
76
+
});
77
+
```
78
+
66
79
### Colours
67
80
68
81
As of version **3.0.0** colours are enabled by default. This feature uses the [`styleText`](https://nodejs.org/api/util.html#utilstyletextformat-text-options) function from [`node:util`](https://nodejs.org/api/util.html) if it is available (Node versions greater than **22.0.0**, **21.7.0** or **20.12.0**). If it's not available, no colours will be displayed.
0 commit comments