npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

progress.js

v1.1.3

Published

A simple but powerful progress indicator for web

Readme

Progress.js

A simple but powerful progress bar indicator for web.

How to use

Use as a npm dependency:

npm install --save progress.js

And include it in your project:

var Progress = require('progress.js')

Use an umd version

Clone or install this project to your local machine, and include lib/progress.min.js to your HTML file.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Progress.js Demo</title>
    <script src="/path/to/progress.min.js"></script>
    <script>
        // place to create a Progress instance
    </script>
</head>
<body>
    
</body>
</html>

API

Class

Uploader

Creating an uploader instance.

Parameters:

  • options A configuration object. Default options are:
const defaultOption = {
  // element which the progress bar element will append to
  element: body, 

  // progress bar's position
  position: 'top', 

  // progress bar's color, accepts two kinds of format:
  // `#ffffff` and `rgb(255,255,255)`
  color: 'rgb(2, 141, 192)' 
}

Returns:

  • Progress instance

Examples:

const progress = new Progress({
  element: document.querySelector('.progress'),
  color: 'rgb(0,0,0)'
})

Instance

progress.start(algorithm)

Start loading the progress bar. Progress bar will increase automatically.

Parameters:

  • algorithm: String Progress bar increase algorithm. Supported algorithm is(will add more in the future):
    • linear

Returns:

  • Current Progress instance

Example:

const progress = new Progress()
progress.start()

progress.stop()

Stop increase the progress bar.

Parameters: none

Returns:

  • Current Progress instance

Examples:

const progress = new Progress()
const stopBtn = document.querySelector('button')
progress.start()

stopBtn.addEventListener('click', function () {
  progress.stop()
})

progress.end()

Finish loading. Progress bar will immediately increase to 100%, and fade away slowly.

Parameters: none

Returns:

  • Current Progress instance

Examples:

const progress = new Progress()
const finishBtn = document.querySelector('button')
progress.start()

finishBtn.addEventListener('click', function () {
  progress.end()
})

progress.set(percentage)

Set the current progress bar's percentage.

Parameters:

  • percentage: Number Progress bar's percentage value. The valid value is between 0 and 100.

Returns:

  • Current Progress instance

Examples:

const progress = new Progress()
progress.start()

setTimeout(function () {
  progress.set(50)
}, 1000)

progress.setColor(Color)

Change the progress bar's color.

Parameters:

  • Color: String Target color. Color format can be a hex value or a RGB value

Returns:

  • Current Progress instance

Examples:

const progress = new Progress()
const changeColorBtn = document.querySelector('button')
progress.start()

changeColorBtn.addEventListener('click', function () {
  progress.setColor('#234567')
})

progress.on(eventName, fn[, context])

Listen to Progress instance's event.

Parameters:

  • eventName: String Target event name. Supported events are:

    • progress: will be fired when the progress bar is loading
    • start: will be fired when the progress bar starting loading
    • stop: will be fired when stopping loading
    • set: will be fired when manually setting the percentage
    • end: will be fired when progress is ending
    • setColor: will be fired when setting color
  • fn: Function Function that will be called when the event is fired.

  • context: Object, optional Callback function's context.

Returns:

  • Current Progress instance

Examples:

const progress = new Progress()
progress.on('progress', function () {
  console.log('in progress')
})
progress.start()

progress.trigger(eventName[, ...argN])

Manually trigger an event.

Parameters:

  • eventName: String Event name to triggered.

  • argN: Any Arguments to pass to the callback function.

Returns:

  • Current Progress instance

Examples:

const progress = new Progress()
progress.start()

progress.on('progress', function (percentage) {
  if (percentage == 50) {
    progress.trigger('customEvent', percentage)
  }
})

progress.on('customEvent', function (arg) {
  console.log(arg)
})

Property

  • percent Current progress value. The value in between 0 and 100.
  • id Current Progress instance id.
  • status Current Progress instance status, value can be waiting, loading.
  • options Progress instance's configuration object.

Development

  • Clone this project to your local machine.
  • Run npm install
  • Run npm start

Licence

MIT