Socket
Socket
Sign inDemoInstall

pixl-cli

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pixl-cli - npm Package Compare versions

Comparing version 1.0.20 to 1.0.21

9

cli.js

@@ -529,2 +529,3 @@ // Tools for writing command-line apps in Node.

},
pct: true,
width: 30,

@@ -634,7 +635,9 @@ freq: 100,

line += cli.applyStyles( args.braces[1], args.styles.braces );
line += " ";
// percentage
var pct = cli.pct(args.amount, args.max, true);
line += cli.applyStyles( pct, args.styles.pct );
if (args.pct) {
line += " ";
var pct = cli.pct(args.amount, args.max, true);
line += cli.applyStyles( pct, args.styles.pct );
}

@@ -641,0 +644,0 @@ // remaining

{
"name": "pixl-cli",
"version": "1.0.20",
"version": "1.0.21",
"description": "Tools for building command-line apps for Node.js.",

@@ -5,0 +5,0 @@ "author": "Joseph Huckaby <jhuckaby@gmail.com>",

@@ -15,2 +15,3 @@ <details><summary>Table of Contents</summary>

* [Command-Line Arguments](#command-line-arguments)
+ [Argument Aliases](#argument-aliases)
+ [Verbose Mode](#verbose-mode)

@@ -28,2 +29,3 @@ + [Quiet Mode](#quiet-mode)

+ [Customizing the Look](#customizing-the-look)
+ [Indeterminite Progress](#indeterminite-progress)
+ [Changing Color Styles](#changing-color-styles)

@@ -512,2 +514,3 @@ + [Automatic Width](#automatic-width)

| `styles` | A set of color styles to use (see [Changing Color Styles](#changing-color-styles) below). |
| `pct` | Show percentage (defaults to `true`). |

@@ -560,2 +563,8 @@ If you call `cli.progress.update()` and pass in a number, the library assumes you are just updating the `amount`. However, if you pass in an object, all the specified properties are updated.

### Indeterminite Progress
For indeterminate progress, simply set the `amount` to the `max`. If these two values are identical, the progress bar is shown in an "indeterminate" state (e.g. the filled portion of the bar is drawn in a different color, default `gray`). This is to handle cases where a job "sits at 100%" but isn't quite complete, and also handle deliberate intermintate jobs (i.e. your code can just set the `amount` to the `max` to show an interminate bar). This also hides the time remaining.
For an additional UI hint, if you know your job is going to be indeterminate from the start, set the `pct` option to `false` to hide the percentage display. Otherwise it'll show "100%" during indeterminacy.
### Changing Color Styles

@@ -581,3 +590,3 @@

The `indeterminate` style is applied to the filled portion of the bar when the `amount` is exactly equal to the `max`. This is to handle cases where a job "sits at 100%" but isn't quite complete, and also handle deliberate intermintate jobs (i.e. your code can just set the `amount` to the `max` to show an interminate bar). This also hides the time remaining.
The `indeterminate` style is applied to the filled portion of the bar when the `amount` is exactly equal to the `max`.

@@ -584,0 +593,0 @@ ### Automatic Width

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