Comparing version 5.1.0 to 5.2.0
34
index.js
@@ -10,3 +10,3 @@ 'use strict'; | ||
const isInteractive = require('is-interactive'); | ||
const MuteStream = require('mute-stream'); | ||
const {BufferListStream} = require('bl'); | ||
@@ -22,5 +22,4 @@ const TEXT = Symbol('text'); | ||
this.mutedStream = new MuteStream(); | ||
this.mutedStream = new BufferListStream(); | ||
this.mutedStream.pipe(process.stdout); | ||
this.mutedStream.mute(); | ||
@@ -187,2 +186,7 @@ const self = this; | ||
set text(value) { | ||
this[TEXT] = value; | ||
this.updateLineCount(); | ||
} | ||
get prefixText() { | ||
@@ -192,2 +196,7 @@ return this[PREFIX_TEXT]; | ||
set prefixText(value) { | ||
this[PREFIX_TEXT] = value; | ||
this.updateLineCount(); | ||
} | ||
get isSpinning() { | ||
@@ -212,17 +221,8 @@ return this.id !== undefined; | ||
const fullPrefixText = this.getFullPrefixText(this.prefixText, '-'); | ||
this.lineCount = stripAnsi(fullPrefixText + '--' + this[TEXT]).split('\n').reduce((count, line) => { | ||
return count + Math.max(1, Math.ceil(wcwidth(line) / columns)); | ||
}, 0); | ||
this.lineCount = 0; | ||
for (const line of stripAnsi(fullPrefixText + '--' + this[TEXT]).split('\n')) { | ||
this.lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns)); | ||
} | ||
} | ||
set text(value) { | ||
this[TEXT] = value; | ||
this.updateLineCount(); | ||
} | ||
set prefixText(value) { | ||
this[PREFIX_TEXT] = value; | ||
this.updateLineCount(); | ||
} | ||
get isEnabled() { | ||
@@ -406,3 +406,3 @@ return this._isEnabled && !this.isSilent; | ||
spinner.succeed(); | ||
} catch (_) { | ||
} catch { | ||
spinner.fail(); | ||
@@ -409,0 +409,0 @@ } |
{ | ||
"name": "ora", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"description": "Elegant terminal spinner", | ||
@@ -40,8 +40,8 @@ "license": "MIT", | ||
"dependencies": { | ||
"bl": "^4.0.3", | ||
"chalk": "^4.1.0", | ||
"cli-cursor": "^3.1.0", | ||
"cli-spinners": "^2.4.0", | ||
"cli-spinners": "^2.5.0", | ||
"is-interactive": "^1.0.0", | ||
"log-symbols": "^4.0.0", | ||
"mute-stream": "0.0.8", | ||
"strip-ansi": "^6.0.0", | ||
@@ -51,8 +51,8 @@ "wcwidth": "^1.0.1" | ||
"devDependencies": { | ||
"@types/node": "^14.0.27", | ||
"@types/node": "^14.14.16", | ||
"ava": "^2.4.0", | ||
"get-stream": "^5.1.0", | ||
"tsd": "^0.13.1", | ||
"xo": "^0.25.0" | ||
"get-stream": "^6.0.0", | ||
"tsd": "^0.14.0", | ||
"xo": "^0.36.1" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# ora [![Build Status](https://travis-ci.com/sindresorhus/ora.svg?branch=master)](https://travis-ci.com/github/sindresorhus/ora) | ||
# ora | ||
@@ -264,1 +264,2 @@ > Elegant terminal spinner | ||
- [spinnies](https://github.com/jcarpanelli/spinnies) - Terminal multi-spinner library for Node.js | ||
- [kia](https://github.com/HarryPeach/kia) - Simple terminal spinners for Deno 🦕 |
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
265
23120
+ Addedbl@^4.0.3
+ Addedbase64-js@1.5.1(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedmute-stream@0.0.8
- Removedmute-stream@0.0.8(transitive)
Updatedcli-spinners@^2.5.0