Socket
Book a DemoInstallSign in
Socket

progress-status

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

progress-status

Simple progress reporting in Node.js for long tasks

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Progress status

Simple npm package to report progress of long tasks.

Example

Installation

npm install --save progress-status

In order to use it, you need Node.js 8+. however, I think it should work on lower versions as well, but I have not tested it.

Usage

You can use it in two ways – as a global function or as a local one. Global might be updated from everywhere, without passing it directly (just requiring it).

const progress = require("progress-status");

async function testGlobal() {
  for (let i = 0; i < 1e3; i++) {
    await new Promise(resolve => setTimeout(resolve, 5));

    progress(i / 1e3);
  }
}

You can do it in any file and pass a corresponding value (where 0 is beginning, 1 is end). You can also create it locally and pass around:

const { createProgress } = require("progress-status");
async function testLocal() {
  const localProgress = createProgress();
  for (let i = 0; i < 1e3; i++) {
    await new Promise(resolve => setTimeout(resolve, 5));

    localProgress(i / 1e3);
  }
}

License

MIT

Keywords

progress

FAQs

Package last updated on 11 Dec 2018

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