Socket
Socket
Sign inDemoInstall

@articulate/progress

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @articulate/progress

Cheap, functional, terminal progress bar


Version published
Weekly downloads
235
increased by72.79%
Maintainers
1
Install size
27.4 kB
Created
Weekly downloads
 

Readme

Source

@articulate/progress

@articulate/progress Build Status Coverage Status NSP Status

@articulate/progress

Cheap, functional, terminal progress bar.

Next time you're tempted to process.stderr.write('.') to track the progress of a script... don't. Use this instead.

API

progress : Object -> Number -> ()

To setup your progress bar, execute the module with an optional options object:

const progress = require('@articulate/progress')({ /* options here */ })

The following options are accepted:

NameTypeDefaultDescription
labelString'progress'custom label for your progress bar
streamstream.Writableprocess.stderroutput stream for progress
widthNumber24max width of the bar

The returned function accepts a progress ratio between 0 and 1, and writes the progress bar to the output stream. Each time it is called, it will overwrite the previous state of the progress to appear animated in the console.

const progress = require('@articulate/progress')()

progress(0.55)
//> progress: ⣠ [==============          ] 55%

See demo.js for a slightly more complex example.

FAQs

Last updated on 15 Nov 2017

Did you know?

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

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc