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

@todesktop/updater

v0.1.1

Published

ToDesktop's updater for Electron and other Node apps: a Node-API addon, plus the todesktop-updater sidecar

Readme

@todesktop/updater

ToDesktop's updater for Electron apps (and other Node apps) that ToDesktop builds: it checks for updates, verifies them against the signed release, downloads them and puts them in place, following the update policy in your todesktop.ts. A Node-API addon; npm installs the build for your platform (macOS universal, Linux x64 and arm64 with glibc 2.28 or later, Windows x64 and arm64) from an optional dependency, with the todesktop-updater sidecar beside it.

Proprietary: see LICENSE.

Electron

npm install @todesktop/updater

In the main process, before anything else:

const { app } = require('electron');
const { requestedHook, startUpdates } = require('@todesktop/updater/electron');

// Started by the installer or uninstaller for a lifecycle hook: do it, exit.
if (requestedHook()) app.exit(0);

app.whenReady().then(() => {
  const updates = startUpdates(app);
  updates.onChange((state) => {
    // idle, checking, available, downloading, ready, error, blocked, managed
    if (state.status === 'ready') updates.restart();
  });
});

startUpdates(app) runs your build's policy (when to check, download and install); restart() quits through app.quit(), so your shutdown code runs, and the new version starts after the app exits. Builds that ToDesktop didn't make (electron .) have no identity: updates stay off and say why. Types are in index.d.cts.

The sidecar

Updates the app can't do while it runs (replacing a macOS app bundle after it quits) are finished by todesktop-updater, which is also the helper that asks for an administrator when the app is installed where the user can't write. The updater looks for it beside the app's executable: Contents/MacOS on macOS, beside YourApp.exe on Windows and the executable on Linux.

  • Without one there, startUpdates() uses the copy from the npm package, which must be outside the asar: unpack the platform package (electron-builder unpacks it by itself; with Electron Forge add asar: { unpack: '**/node_modules/@todesktop/updater-*/**' }).

  • For installs that need an administrator to update (a macOS app in /Applications owned by another user, say), copy it beside the executable. With electron-builder:

    {
      "asarUnpack": ["node_modules/@todesktop/updater-*/**"],
      "mac": {
        "extraFiles": [
          {
            "from": "node_modules/@todesktop/updater-darwin-universal/todesktop-updater",
            "to": "MacOS/todesktop-updater"
          }
        ]
      },
      "win": {
        "extraFiles": [
          {
            "from": "node_modules/@todesktop/updater-win32-${arch}-msvc/todesktop-updater.exe",
            "to": "todesktop-updater.exe"
          }
        ]
      },
      "linux": {
        "extraFiles": [
          {
            "from": "node_modules/@todesktop/updater-linux-${arch}-gnu/todesktop-updater",
            "to": "todesktop-updater"
          }
        ]
      }
    }

    (${arch} is x64 or arm64.) require('@todesktop/updater/electron').sidecarPath() says which copy the app uses.

Ship it unsigned: ToDesktop signs it with your certificate along with the rest of the app, and refuses a Windows build whose todesktop-updater.exe isn't the hardened one from this package.

Other Node apps

const { Updates } = require('@todesktop/updater');
const updates = Updates.fromCurrentExe(); // or Updates.fromAppDir(dir)
updates.start();

Versions

The package's version is the ToDesktop runtime version, shared with the todesktop-updater and tauri-plugin-todesktop crates; the updater sends it with every request (x-td-runtime-version). ToDesktop's servers keep working with every runtime version.