You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

progress-smoother

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

progress-smoother

Smoothing function for progress bars (e.g. upload, download, etc.)

1.7.0
latest
Source
npmnpm
Version published
Weekly downloads
12K
-6.56%
Maintainers
2
Weekly downloads
 
Created
Source

progress-smoother

Smoothing Function for Progress Bars



Twitter URL

Installation

npm install progress-smoother

Usage

const { ProgressSmoother } = require("progress-smoother")

const progress = ProgressSmoother({
  // Required.
  maxValue: 12345,                  // Maximum value of your progress bar.
  valueIncreaseRatePerSecond: 5000, // Estimated minimum throughput for '.setValue()' calls.
  valueIncreaseDelta: 500,          // Estimated minimum delta between '.setValue()' calls.
  averageTimeBetweenValues: 5000,   // Estimated mean time between '.setValue()' calls in milliseconds.
  minDelayUntilFirstValue: 6000,    // Estimated minimum delay until the first '.setValue()' call is made.

  // Optional.
  teardownTime: 2000                // Latency your app introduces after 100% progress (the function incorporates it).
});

// Report progress events:
progress.setValue(1025);
progress.setValue(3201);
...
progress.setValue(12345);

// Get smoothed progress any time (e.g. on a fixed interval):
progress.smoothedFactor(); // Returns 0..1

Contribute

If you would like to contribute to progress-smoother:

  • Add a GitHub Star to the project (if you're feeling generous!).
  • Determine whether you're raising a bug, feature request or question.
  • Raise your issue or PR. 🚀

License

MIT

Keywords

smoothing

FAQs

Package last updated on 16 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.