\begin{quote}
Elegant terminal spinner \end{quote}


~\newline
  ~\newline
 \hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19205}{}\doxysection{Install}\label{md_sfcode_node_modules_ora_readme_autotoc_md19205}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install ora }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19206}{}\doxysection{Usage}\label{md_sfcode_node_modules_ora_readme_autotoc_md19206}

\begin{DoxyCode}{0}
\DoxyCodeLine{const ora = require('ora');}
\DoxyCodeLine{}
\DoxyCodeLine{const spinner = ora('Loading unicorns').start();}
\DoxyCodeLine{}
\DoxyCodeLine{setTimeout(() => \{}
\DoxyCodeLine{    spinner.color = 'yellow';}
\DoxyCodeLine{    spinner.text = 'Loading rainbows';}
\DoxyCodeLine{\}, 1000); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19207}{}\doxysection{API}\label{md_sfcode_node_modules_ora_readme_autotoc_md19207}
\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19208}{}\doxysubsection{ora(text)}\label{md_sfcode_node_modules_ora_readme_autotoc_md19208}
\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19209}{}\doxysubsection{ora(options)}\label{md_sfcode_node_modules_ora_readme_autotoc_md19209}
If a string is provided, it is treated as a shortcut for \href{\#text}{\texttt{ {\ttfamily options.\+text}}}.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19210}{}\doxysubsubsection{options}\label{md_sfcode_node_modules_ora_readme_autotoc_md19210}
Type\+: {\ttfamily object}\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19211}{}\doxyparagraph{text}\label{md_sfcode_node_modules_ora_readme_autotoc_md19211}
Type\+: {\ttfamily string}

Text to display after the spinner.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19212}{}\doxyparagraph{prefix\+Text}\label{md_sfcode_node_modules_ora_readme_autotoc_md19212}
Type\+: {\ttfamily string}

Text to display before the spinner. No prefix text will be displayed if set to an empty string.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19213}{}\doxyparagraph{spinner}\label{md_sfcode_node_modules_ora_readme_autotoc_md19213}
Type\+: {\ttfamily string $\vert$ object}\textbackslash{} Default\+: `\textquotesingle{}dots'\`{} 

Name of one of the \href{https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json}{\texttt{ provided spinners}}. See {\ttfamily example.\+js} in this repo if you want to test out different spinners. On Windows, it will always use the {\ttfamily line} spinner as the Windows command-\/line doesn\textquotesingle{}t have proper Unicode support.

Or an object like\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\{}
\DoxyCodeLine{    interval: 80, // Optional}
\DoxyCodeLine{    frames: ['-\/', '+', '-\/']}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19214}{}\doxyparagraph{color}\label{md_sfcode_node_modules_ora_readme_autotoc_md19214}
Type\+: {\ttfamily string}\textbackslash{} Default\+: `\textquotesingle{}cyan'{\ttfamily \textbackslash{} Values\+:}\textquotesingle{}black\textquotesingle{} $\vert$ \textquotesingle{}red\textquotesingle{} $\vert$ \textquotesingle{}green\textquotesingle{} $\vert$ \textquotesingle{}yellow\textquotesingle{} $\vert$ \textquotesingle{}blue\textquotesingle{} $\vert$ \textquotesingle{}magenta\textquotesingle{} $\vert$ \textquotesingle{}cyan\textquotesingle{} $\vert$ \textquotesingle{}white\textquotesingle{} $\vert$ \textquotesingle{}gray\textquotesingle{}\`{}

Color of the spinner.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19215}{}\doxyparagraph{hide\+Cursor}\label{md_sfcode_node_modules_ora_readme_autotoc_md19215}
Type\+: {\ttfamily boolean}\textbackslash{} Default\+: {\ttfamily true}

Set to {\ttfamily false} to stop Ora from hiding the cursor.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19216}{}\doxyparagraph{indent}\label{md_sfcode_node_modules_ora_readme_autotoc_md19216}
Type\+: {\ttfamily number}\textbackslash{} Default\+: {\ttfamily 0}

Indent the spinner with the given number of spaces.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19217}{}\doxyparagraph{interval}\label{md_sfcode_node_modules_ora_readme_autotoc_md19217}
Type\+: {\ttfamily number}\textbackslash{} Default\+: Provided by the spinner or {\ttfamily 100}

Interval between each frame.

Spinners provide their own recommended interval, so you don\textquotesingle{}t really need to specify this.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19218}{}\doxyparagraph{stream}\label{md_sfcode_node_modules_ora_readme_autotoc_md19218}
Type\+: {\ttfamily stream.\+Writable}\textbackslash{} Default\+: {\ttfamily process.\+stderr}

Stream to write the output.

You could for example set this to {\ttfamily process.\+stdout} instead.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19219}{}\doxyparagraph{is\+Enabled}\label{md_sfcode_node_modules_ora_readme_autotoc_md19219}
Type\+: {\ttfamily boolean}

Force enable/disable the spinner. If not specified, the spinner will be enabled if the {\ttfamily stream} is being run inside a TTY context (not spawned or piped) and/or not in a CI environment.

Note that {\ttfamily \{is\+Enabled\+: false\}} doesn\textquotesingle{}t mean it won\textquotesingle{}t output anything. It just means it won\textquotesingle{}t output the spinner, colors, and other ansi escape codes. It will still log text.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19220}{}\doxyparagraph{discard\+Stdin}\label{md_sfcode_node_modules_ora_readme_autotoc_md19220}
Type\+: {\ttfamily boolean}\textbackslash{} Default\+: {\ttfamily true}

Discard stdin input (except Ctrl+C) while running if it\textquotesingle{}s TTY. This prevents the spinner from twitching on input, outputting broken lines on {\ttfamily Enter} key presses, and prevents buffering of input while the spinner is running.

This has no effect on Windows as there\textquotesingle{}s no good way to implement discarding stdin properly there.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19221}{}\doxysubsection{Instance}\label{md_sfcode_node_modules_ora_readme_autotoc_md19221}
\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19222}{}\doxysubsubsection{.\+start(text?)}\label{md_sfcode_node_modules_ora_readme_autotoc_md19222}
Start the spinner. Returns the instance. Set the current text if {\ttfamily text} is provided.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19223}{}\doxysubsubsection{.\+stop()}\label{md_sfcode_node_modules_ora_readme_autotoc_md19223}
Stop and clear the spinner. Returns the instance.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19224}{}\doxysubsubsection{.\+succeed(text?)}\label{md_sfcode_node_modules_ora_readme_autotoc_md19224}
Stop the spinner, change it to a green {\ttfamily ✔} and persist the current text, or {\ttfamily text} if provided. Returns the instance. See the GIF below.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19225}{}\doxysubsubsection{.\+fail(text?)}\label{md_sfcode_node_modules_ora_readme_autotoc_md19225}
Stop the spinner, change it to a red {\ttfamily ✖} and persist the current text, or {\ttfamily text} if provided. Returns the instance. See the GIF below.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19226}{}\doxysubsubsection{.\+warn(text?)}\label{md_sfcode_node_modules_ora_readme_autotoc_md19226}
Stop the spinner, change it to a yellow {\ttfamily ⚠} and persist the current text, or {\ttfamily text} if provided. Returns the instance.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19227}{}\doxysubsubsection{.\+info(text?)}\label{md_sfcode_node_modules_ora_readme_autotoc_md19227}
Stop the spinner, change it to a blue {\ttfamily ℹ} and persist the current text, or {\ttfamily text} if provided. Returns the instance.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19228}{}\doxysubsubsection{.\+is\+Spinning}\label{md_sfcode_node_modules_ora_readme_autotoc_md19228}
A boolean of whether the instance is currently spinning.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19229}{}\doxysubsubsection{.\+stop\+And\+Persist(options?)}\label{md_sfcode_node_modules_ora_readme_autotoc_md19229}
Stop the spinner and change the symbol or text. Returns the instance. See the GIF below.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19230}{}\doxyparagraph{options}\label{md_sfcode_node_modules_ora_readme_autotoc_md19230}
Type\+: {\ttfamily object}

\doxysubparagraph*{symbol}

Type\+: {\ttfamily string}\textbackslash{} Default\+: `' \textquotesingle{}\`{}

Symbol to replace the spinner with.

\doxysubparagraph*{text}

Type\+: {\ttfamily string}\textbackslash{} Default\+: Current `\textquotesingle{}text'\`{}

Text to be persisted after the symbol

\doxysubparagraph*{prefix\+Text}

Type\+: {\ttfamily string}\textbackslash{} Default\+: Current {\ttfamily prefix\+Text}

Text to be persisted before the symbol. No prefix text will be displayed if set to an empty string.

\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19231}{}\doxysubsubsection{.\+clear()}\label{md_sfcode_node_modules_ora_readme_autotoc_md19231}
Clear the spinner. Returns the instance.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19232}{}\doxysubsubsection{.\+render()}\label{md_sfcode_node_modules_ora_readme_autotoc_md19232}
Manually render a new frame. Returns the instance.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19233}{}\doxysubsubsection{.\+frame()}\label{md_sfcode_node_modules_ora_readme_autotoc_md19233}
Get a new frame.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19234}{}\doxysubsubsection{.\+text}\label{md_sfcode_node_modules_ora_readme_autotoc_md19234}
Change the text after the spinner.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19235}{}\doxysubsubsection{.\+prefix\+Text}\label{md_sfcode_node_modules_ora_readme_autotoc_md19235}
Change the text before the spinner. No prefix text will be displayed if set to an empty string.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19236}{}\doxysubsubsection{.\+color}\label{md_sfcode_node_modules_ora_readme_autotoc_md19236}
Change the spinner color.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19237}{}\doxysubsubsection{.\+spinner}\label{md_sfcode_node_modules_ora_readme_autotoc_md19237}
Change the spinner.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19238}{}\doxysubsubsection{.\+indent}\label{md_sfcode_node_modules_ora_readme_autotoc_md19238}
Change the spinner indent.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19239}{}\doxysubsection{ora.\+promise(action, text)}\label{md_sfcode_node_modules_ora_readme_autotoc_md19239}
\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19240}{}\doxysubsection{ora.\+promise(action, options)}\label{md_sfcode_node_modules_ora_readme_autotoc_md19240}
Starts a spinner for a promise. The spinner is stopped with {\ttfamily .succeed()} if the promise fulfills or with {\ttfamily .fail()} if it rejects. Returns the spinner instance.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19241}{}\doxysubsubsection{action}\label{md_sfcode_node_modules_ora_readme_autotoc_md19241}
Type\+: {\ttfamily Promise}\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19242}{}\doxysection{FAQ}\label{md_sfcode_node_modules_ora_readme_autotoc_md19242}
\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19243}{}\doxysubsection{How do I change the color of the text?}\label{md_sfcode_node_modules_ora_readme_autotoc_md19243}
Use \href{https://github.com/chalk/chalk}{\texttt{ Chalk}}\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{const ora = require('ora');}
\DoxyCodeLine{const chalk = require('chalk');}
\DoxyCodeLine{}
\DoxyCodeLine{const spinner = ora(`Loading \$\{chalk.red('unicorns')\}`).start(); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19244}{}\doxysubsection{Why does the spinner freeze?}\label{md_sfcode_node_modules_ora_readme_autotoc_md19244}
Java\+Script is single-\/threaded, so synchronous operations blocks the thread, including the spinner animation. Prefer asynchronous operations whenever possible.\hypertarget{md_sfcode_node_modules_ora_readme_autotoc_md19245}{}\doxysection{Related}\label{md_sfcode_node_modules_ora_readme_autotoc_md19245}

\begin{DoxyItemize}
\item \href{https://github.com/sindresorhus/cli-spinners}{\texttt{ cli-\/spinners}} -\/ Spinners for use in the terminal
\item \href{https://github.com/SamVerschueren/listr}{\texttt{ listr}} -\/ Terminal task list
\item \href{https://github.com/kiliankoe/CLISpinner}{\texttt{ CLISpinner}} -\/ Terminal spinner library for Swift
\item \href{https://github.com/ManrajGrover/halo}{\texttt{ halo}} -\/ Python port
\item \href{https://github.com/FGRibreau/spinners}{\texttt{ spinners}} -\/ Terminal spinners for Rust
\item \href{https://github.com/joeycozza/marquee-ora}{\texttt{ marquee-\/ora}} -\/ Scrolling marquee spinner for Ora
\item \href{https://github.com/briandowns/spinner}{\texttt{ briandowns/spinner}} -\/ Terminal spinner/progress indicator for Go
\item \href{https://github.com/tj/go-spin}{\texttt{ tj/go-\/spin}} -\/ Terminal spinner package for Go
\item \href{https://observablehq.com/@victordidenko/ora}{\texttt{ observablehq.\+com/@victordidenko/ora}} -\/ Ora port to Observable notebooks
\item \href{https://github.com/jcarpanelli/spinnies}{\texttt{ spinnies}} -\/ Terminal multi-\/spinner library for Node.\+js 
\end{DoxyItemize}