Comparing version 0.2.1 to 0.2.2
10
index.js
@@ -37,3 +37,3 @@ 'use strict'; | ||
this.frameIndex = 0; | ||
this.enabled = (this.stream && this.stream.isTTY) && !process.env.CI; | ||
this.enabled = this.options.enabled || ((this.stream && this.stream.isTTY) && !process.env.CI); | ||
} | ||
@@ -61,2 +61,4 @@ | ||
this.stream.cursorTo(0); | ||
return this; | ||
}; | ||
@@ -67,2 +69,4 @@ | ||
this.stream.write(this.frame()); | ||
return this; | ||
}; | ||
@@ -78,2 +82,4 @@ | ||
this.id = setInterval(this.render.bind(this), this.interval); | ||
return this; | ||
}; | ||
@@ -91,4 +97,6 @@ | ||
cliCursor.show(); | ||
return this; | ||
}; | ||
module.exports = Ora; |
{ | ||
"name": "ora", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Elegant terminal spinner", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -20,6 +20,4 @@ # ora [![Build Status](https://travis-ci.org/sindresorhus/ora.svg?branch=master)](https://travis-ci.org/sindresorhus/ora) | ||
const spinner = ora('Loading unicorns'); | ||
const spinner = ora('Loading unicorns').start(); | ||
spinner.start(); | ||
setTimeout(() => { | ||
@@ -92,2 +90,9 @@ spinner.color = 'yellow'; | ||
##### enabled | ||
Type: `boolean`<br> | ||
Default: `false` | ||
Force enabling of the spinner regardless of the `stream` not being run inside a TTY context and/or in a CI environment. | ||
### Instance | ||
@@ -97,12 +102,16 @@ | ||
Start the spinner. | ||
Start the spinner. Returns the instance. | ||
#### .stop() | ||
Stop and clear the spinner. | ||
Stop and clear the spinner. Returns the instance. | ||
#### .clear() | ||
Clear the spinner. | ||
Clear the spinner. Returns the instance. | ||
#### .render() | ||
Manually render a new frame. Returns the instance. | ||
#### .frame() | ||
@@ -112,6 +121,2 @@ | ||
#### .render() | ||
Manually render a new frame. | ||
#### .text | ||
@@ -118,0 +123,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6211
75
135