Comparing version 0.1.1 to 0.2.0
10
index.js
@@ -8,2 +8,12 @@ 'use strict'; | ||
function Ora(options) { | ||
if (!(this instanceof Ora)) { | ||
return new Ora(options); | ||
} | ||
if (typeof options === 'string') { | ||
options = { | ||
text: options | ||
}; | ||
} | ||
this.options = objectAssign({ | ||
@@ -10,0 +20,0 @@ text: '', |
{ | ||
"name": "ora", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Elegant terminal spinner", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -18,5 +18,5 @@ # ora [![Build Status](https://travis-ci.org/sindresorhus/ora.svg?branch=master)](https://travis-ci.org/sindresorhus/ora) | ||
```js | ||
const Ora = require('ora'); | ||
const ora = require('ora'); | ||
const spinner = new Ora({text: 'Loading unicorns'}); | ||
const spinner = ora('Loading unicorns'); | ||
@@ -36,6 +36,10 @@ spinner.start(); | ||
### Ora([options]) | ||
### ora([options|text]) | ||
If a string is provided, it is treated as a shortcut for [`options.text`](#text). | ||
#### options | ||
Type: `object` | ||
##### text | ||
@@ -42,0 +46,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
5862
71
130