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

pear-runtime-updater

v2.0.2

Published

Listens for OTA Pear App updates

Readme

pear-runtime-updater

Listens for OTA Pear App updates

npm install pear-runtime-updater

Listens for P2P over-the-air (OTA) updates for Pear apps. Replicates from a pear upgrade link and emits when a new version is available.

MVP - EXPERIMENTAL

This boilerplate is MVP and Experimental.

Usage

const PearRuntimeUpdater = require('pear-runtime-updater')
const path = require('path')
const { version, upgrade } = require('./package.json')

function getApp() {
  return path.join(process.resourcesPath, '../..')
}

const updater = new PearRuntimeUpdater({
  dir: path.join(app.getPath('userData')),
  upgrade,
  version,
  app: getApp() // path to .app / .AppImage
  name: 'name.ext' // <name>.app, <name>.AppImage, <name>.msix
})

await updater.ready()

updater.on('updating', () => console.log('Update downloading…'))
updater.on('updated', async () => {
  console.log('Update ready')
  await updater.applyUpdate()
  app.relaunch()
  app.exit(0)
})

process.on('beforeExit', () => updater.close())

Features

  • Peer-to-peer over-the-air (P2P OTA) update listening
  • Replicates update content via Hyperdrive / Hyperswarm
  • Emits when an update is in progress, update diffs and when it’s ready
  • applyUpdate() to atomic swap the new build (bundled apps; macOS/Linux)

API

const updater = new PearRuntimeUpdater(opts)

  • opts.dir – (required) Directory to store data (e.g. app data dir).
  • opts.upgrade – (required) Pear upgrade link (e.g. from package.json upgrade field).
  • opts.name – (required) Application name with extension.
  • opts.version – (optional) Current app version; used to decide if an update should be stored.
  • opts.app – (optional) Path to the app bundle (for bundled apps; used with applyUpdate()).
  • opts.bundled – (optional) Whether the app is bundled. Defaults to !!opts.app.
  • opts.updates – (optional) Set to false to opt out of updates.

updater.on('updating')

Emitted when an update is in progress.

updater.on('updating-delta', data)

Emitted with progress data while mirroring the update.

updater.on('updated')

Emitted when the update is fully downloaded and ready. After this, updater.next is the path to the staged update.

updater.next

After updated, the path to the staged update (e.g. for use with applyUpdate() or custom install logic).

await updater.applyUpdate()

Apply the update by swapping the current app with the received build through atomic swap. Only valid after updated, when opts.bundled is true.

await updater.close()

Shut it down. You should do this when closing your app for best performance.

License

Apache-2.0