# ora [](https://travis-ci.org/sindresorhus/ora) > Elegant terminal spinner
	
	
	
 ## Usage
```js
const ora = require('ora');
const spinner = ora('Loading unicorns').start();
setTimeout(() => {
	spinner.color = 'yellow';
	spinner.text = 'Loading rainbows';
}, 1000);
```
## API
### ora([options|text])
If a string is provided, it is treated as a shortcut for [`options.text`](#text).
#### options
Type: `Object`
##### text
Type: `string`
Text to display after the spinner.
##### prefixText
Type: `string`
Text to display before the spinner.
##### spinner
Type: `string` `Object`
## Usage
```js
const ora = require('ora');
const spinner = ora('Loading unicorns').start();
setTimeout(() => {
	spinner.color = 'yellow';
	spinner.text = 'Loading rainbows';
}, 1000);
```
## API
### ora([options|text])
If a string is provided, it is treated as a shortcut for [`options.text`](#text).
#### options
Type: `Object`
##### text
Type: `string`
Text to display after the spinner.
##### prefixText
Type: `string`
Text to display before the spinner.
##### spinner
Type: `string` `Object` Name of one of the [provided spinners](https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json). 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.
Or an object like:
```js
{
	interval: 80, // Optional
	frames: ['-', '+', '-']
}
```
##### color
Type: `string`
Name of one of the [provided spinners](https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json). 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.
Or an object like:
```js
{
	interval: 80, // Optional
	frames: ['-', '+', '-']
}
```
##### color
Type: `string` #### .clear()
Clear the spinner. Returns the instance.
#### .render()
Manually render a new frame. Returns the instance.
#### .frame()
Get a new frame.
#### .text
Change the text after the spinner.
#### .prefixText
Change the text before the spinner.
#### .color
Change the spinner color.
#### .spinner
Change the spinner.
#### .indent
Change the spinner indent.
### ora.promise(action, [options|text])
Starts a spinner for a promise. The spinner is stopped with `.succeed()` if the promise fulfills or with `.fail()` if it rejects. Returns the spinner instance.
#### action
Type: `Promise`
## Related
- [cli-spinners](https://github.com/sindresorhus/cli-spinners) - Spinners for use in the terminal
- [listr](https://github.com/SamVerschueren/listr) - Terminal task list
- [CLISpinner](https://github.com/kiliankoe/CLISpinner) - Terminal spinner library for Swift
- [halo](https://github.com/ManrajGrover/halo) - Python port
- [spinners](https://github.com/FGRibreau/spinners) - Terminal spinners for Rust
- [marquee-ora](https://github.com/joeycozza/marquee-ora) - Scrolling marquee spinner for Ora
- [briandowns/spinner](https://github.com/briandowns/spinner) - Terminal spinner/progress indicator for Go
- [tj/go-spin](https://github.com/tj/go-spin) - Terminal spinner package for Go
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
#### .clear()
Clear the spinner. Returns the instance.
#### .render()
Manually render a new frame. Returns the instance.
#### .frame()
Get a new frame.
#### .text
Change the text after the spinner.
#### .prefixText
Change the text before the spinner.
#### .color
Change the spinner color.
#### .spinner
Change the spinner.
#### .indent
Change the spinner indent.
### ora.promise(action, [options|text])
Starts a spinner for a promise. The spinner is stopped with `.succeed()` if the promise fulfills or with `.fail()` if it rejects. Returns the spinner instance.
#### action
Type: `Promise`
## Related
- [cli-spinners](https://github.com/sindresorhus/cli-spinners) - Spinners for use in the terminal
- [listr](https://github.com/SamVerschueren/listr) - Terminal task list
- [CLISpinner](https://github.com/kiliankoe/CLISpinner) - Terminal spinner library for Swift
- [halo](https://github.com/ManrajGrover/halo) - Python port
- [spinners](https://github.com/FGRibreau/spinners) - Terminal spinners for Rust
- [marquee-ora](https://github.com/joeycozza/marquee-ora) - Scrolling marquee spinner for Ora
- [briandowns/spinner](https://github.com/briandowns/spinner) - Terminal spinner/progress indicator for Go
- [tj/go-spin](https://github.com/tj/go-spin) - Terminal spinner package for Go
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)