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

@spaceagetv/electron-progress-window

v2.3.2

Published

Display single or multiple progress bars in an Electron app

Readme

electron-progress-window

Display multiple progress bars in an Electron window.

npm version npm downloads Tests License: MIT TypeScript Node.js

Advantages

  • Full Typescript support, including event types
  • Zero runtime dependencies
  • Full documentation
  • Example playground to try it out in an Electron app
  • Progress bars are displayed in a single window (or multiple windows if you prefer)
  • ProgressWindows and ProgressItems are event emitters
  • Progress items can be added and removed dynamically
  • Progress items can be updated dynamically
  • Progress bars can be indeterminate (no value) or determinate (with value)
  • Window can adjust size automatically as progress items are added and removed
  • Automatically close window when all progress items are complete (or not)
  • Configure default options for ProgressWindow and ProgressItem instances
  • Choose whether individual progress bars are removed from window when complete
  • Individual progress bars can be paused and resumed, sending 'pause' event
  • Progress bars can be cancelled, sending 'will-cancel' and 'cancelled' event
  • Ability to add custom CSS or HTML (in title or detail)
  • Ability to fully customize the Electron BrowserWindow options
  • Full test coverage

Screenshot

Installation

npm install @spaceagetv/electron-progress-window

Fonts and images in custom CSS

The progress page is loaded from a data: URL, which has an opaque origin. Together with the window's sandbox and webSecurity settings, that means the page cannot fetch subresources of any kind — not file://, not a relative path, not a custom protocol registered by your app. Any url() in the css option pointing at a file will silently fail to load.

Use inlineAsset() to embed the file in the stylesheet instead:

const path = require('path')
const { ProgressWindow, inlineAsset } = require('@spaceagetv/electron-progress-window')

const brandFont = inlineAsset(path.join(__dirname, 'assets/brand.woff2'))

ProgressWindow.configure({
  css: `
    @font-face {
      font-family: 'Brand';
      src: url('${brandFont}') format('woff2');
    }
    html {
      --font-family: 'Brand', sans-serif;
    }
  `,
})

The media type is inferred from the file extension for common font and image formats; pass it as a second argument for anything else.

Inlined assets end up in the page URL, so watch the total size — a full variable font is roughly 75 KB of base64 before encodeURIComponent expands +, / and =. Subsetting a font to the characters you actually use makes a large difference.

Theming

The window's colors, shadows and hover states are driven by CSS custom properties. Pass a stylesheet through the css option, or set individual properties per item with cssVars — see itemCssMap for the full list of what is configurable. Anything not covered there can still be overridden with an ordinary CSS rule through the css option.

Design systems usually scope their token file to a selector such as [data-theme="dark"] or .theme-dark. Use htmlAttributes or bodyClass to put that selector on the progress page's root element, so the token file can be injected verbatim instead of being rewritten:

ProgressWindow.configure({
  htmlAttributes: { 'data-theme': 'dark' },
  // or: bodyClass: 'theme-dark',
  css: fs.readFileSync('./design-system/tokens.css', 'utf8'),
})

To flatten the default glossy progress bar:

ProgressWindow.configure({
  css: `
    html {
      --progress-shadow: none;
      --indicator-shadow: none;
    }
  `,
})

Usage

const { ProgressWindow } = require('@spaceagetv/electron-progress-window')

// Configure the settings for ProgressWindow
ProgressWindow.configure({
  closeOnComplete: true,
  focusOnAdd: true,
  windowOptions: { // these are Electron BrowserWindow options
    title: 'Progress',
    width: 300,
    height: 60,
    backgroundColor: '#f00',
  },
})

async function somethingThatTakesTime(progressCallback) {
  const state = {
    paused: false,
    cancelled: false,
  }
  for (let i = 0; i < 100; i++) {
    while (state.paused && !state.cancelled) {
      await new Promise((resolve) => setTimeout(resolve, 100))
    }
    if (state.cancelled) {
      break
    }
    await new Promise((resolve) => setTimeout(resolve, 100))
    progressCallback(Math.round((i + 1) / 100 * 100))
  }
  const setPause = (isPaused) => {
    state.paused = isPaused
  }
  const cancel = () => {
    state.cancelled = true
  }
  return { setPause, cancel }
}

async function start() {
  const progressItem = await ProgressWindow.addItem({
    title: 'Something that takes time',
    detail: '0% complete',
    value: 0,
    maxValue: 100,
    pauseable: true,
    cancellable: true,
  })

  const updateProgress = (progress) => {
    progressItem.value = progress
    progressItem.detail = `${progress}% complete`
  }

  const { setPause, cancel } = await somethingThatTakesTime(updateProgress)

  progressItem.on('paused', (isPaused) => {
    setPause(isPaused)
  })
  progressItem.on('cancelled', () => {
    cancel()
  })
}

start()