Socket
Socket
Sign inDemoInstall

ora

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ora - npm Package Compare versions

Comparing version 5.1.0 to 5.4.1

3

index.d.ts

@@ -1,2 +0,1 @@

/// <reference types="node"/>
import {SpinnerName} from 'cli-spinners';

@@ -35,3 +34,3 @@

/**
Name of one of the provided spinners. See [`example.js`](https://github.com/BendingBender/ora/blob/master/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.
Name of one of the provided spinners. See [`example.js`](https://github.com/BendingBender/ora/blob/main/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.

@@ -38,0 +37,0 @@ @default 'dots'

@@ -10,7 +10,7 @@ 'use strict';

const isInteractive = require('is-interactive');
const MuteStream = require('mute-stream');
const isUnicodeSupported = require('is-unicode-supported');
const {BufferListStream} = require('bl');
const TEXT = Symbol('text');
const PREFIX_TEXT = Symbol('prefixText');
const ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code

@@ -22,7 +22,6 @@

this.mutedStream = new MuteStream();
this.mutedStream = new BufferListStream();
this.mutedStream.pipe(process.stdout);
this.mutedStream.mute();
const self = this;
const self = this; // eslint-disable-line unicorn/no-this-assignment
this.ourEmit = function (event, data, ...args) {

@@ -169,3 +168,3 @@ const {stdin} = process;

this._spinner = spinner;
} else if (process.platform === 'win32') {
} else if (!isUnicodeSupported()) {
this._spinner = cliSpinners.line;

@@ -175,6 +174,6 @@ } else if (spinner === undefined) {

this._spinner = cliSpinners.dots;
} else if (cliSpinners[spinner]) {
} else if (spinner !== 'default' && cliSpinners[spinner]) {
this._spinner = cliSpinners[spinner];
} else {
throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json for a full list.`);
throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);
}

@@ -189,2 +188,7 @@

set text(value) {
this[TEXT] = value;
this.updateLineCount();
}
get prefixText() {

@@ -194,2 +198,7 @@ return this[PREFIX_TEXT];

set prefixText(value) {
this[PREFIX_TEXT] = value;
this.updateLineCount();
}
get isSpinning() {

@@ -214,17 +223,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() {

@@ -408,3 +408,3 @@ return this._isEnabled && !this.isSilent;

spinner.succeed();
} catch (_) {
} catch {
spinner.fail();

@@ -411,0 +411,0 @@ }

{
"name": "ora",
"version": "5.1.0",
"version": "5.4.1",
"description": "Elegant terminal spinner",

@@ -40,8 +40,9 @@ "license": "MIT",

"dependencies": {
"bl": "^4.1.0",
"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",
"is-unicode-supported": "^0.1.0",
"log-symbols": "^4.1.0",
"strip-ansi": "^6.0.0",

@@ -51,8 +52,8 @@ "wcwidth": "^1.0.1"

"devDependencies": {
"@types/node": "^14.0.27",
"@types/node": "^14.14.35",
"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.38.2"
}
}

@@ -1,2 +0,2 @@

# ora [![Build Status](https://travis-ci.com/sindresorhus/ora.svg?branch=master)](https://travis-ci.com/github/sindresorhus/ora)
# ora

@@ -58,3 +58,3 @@ > Elegant terminal spinner

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.
Name of one of the [provided spinners](https://github.com/sindresorhus/cli-spinners/blob/main/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.

@@ -265,1 +265,2 @@ Or an object like:

- [spinnies](https://github.com/jcarpanelli/spinnies) - Terminal multi-spinner library for Node.js
- [kia](https://github.com/HarryPeach/kia) - Simple terminal spinners for Deno 🦕
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc