Skip to content

Commit

Permalink
Add ability to disable the spinner (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoducha authored and sindresorhus committed Jan 17, 2017
1 parent 4ceeedd commit 425b21a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Ora {
this.stream = this.options.stream;
this.id = null;
this.frameIndex = 0;
this.enabled = this.options.enabled || ((this.stream && this.stream.isTTY) && !process.env.CI);
this.enabled = typeof this.options.enabled === 'boolean' ? this.options.enabled : ((this.stream && this.stream.isTTY) && !process.env.CI);
}
frame() {
const frames = this.spinner.frames;
Expand Down
5 changes: 2 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ You could for example set this to `process.stdout` instead.

##### enabled

Type: `boolean`<br>
Default: `false`
Type: `boolean`

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

### Instance

Expand Down

0 comments on commit 425b21a

Please sign in to comment.