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

v0.5.0

Published

Embeddable Pear Runtime

Readme

pear-runtime

Embeddable Runtime library for Pear with P2P OTA updates, Bare workers and storage APIs

npm install pear-runtime

This module integrates Pear into JavaScript-based Desktop applications.

See pear-mobile for Pear's embeddable runtime module for Mobile Devices.

MVP - EXPERIMENTAL

This boilerplate is MVP and Experimental.

OS Support

  • MacOS
  • Linux - Work in Progress
  • Windows - Work in Progress

Usage

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

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

const pear = new PearRuntime({
  dir: path.join(__dirname, 'runtime-data'),
  version,
  upgrade,
  app: getApp() // path to .app / .AppImage
})
pear.on('error', console.error) // log network errors etc.
pear.updater.on('updating', () => console.log('Updating...'))
pear.updater.on('updated', () => pear.updater.applyUpdate())

const worker = pear.run(require.resolve('./worker.js'))
worker.on('data', (data) => console.log('worker:', data.toString()))

// be sure to await pear.close() during process teardown

Quick Starts

Electron

git clone https://github.com/holepunchto/hello-pear-electron

For end-to-end instructions from building to deploying with Pear see hello-pear-electron README.md.

WebView

Coming Soon

Features

API

const pear = new PearRuntime(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.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.

IPC <stream.Duplex> = pear.run(path, args = [], opts = {})

Start a bare worker. Returns a duplex stream, the IPC pipe.

In the worker, Bare.IPC is the other end of the pipe.

Worker stdio is available at IPC.stdin, IPC.stdout & IPC.stderr.

pear.storage

Suggested storage folder for app storage.

await pear.ready()

Resolves when ready. Initialization is eager, but can be used to determine when OTA updates are ready.

await pear.close()

Shut down the embedded runtime, including OTA updates. For best performance, be sure to do this when closing the app.

Making updates

VERY EXPERIMENTAL, MOST DEFINITELY WILL CHANGE.

Update listening and apply logic lives in pear-runtime-updater.

First allocate a pear link if you haven't using pear:

pear touch

Store this link in the package.json upgrade field of a project. See example.

Build an app. Take the distributable (e.g .app) produced and make a deployment folder with the following structure:

/package.json
/by-arch
  /[...platform-arch]
    /app

Now go to this folder and stage this onto the link with pear stage

pear stage {link-from-touch}

Now seed it. Any build out there on a lower version will trigger the update flow.

LICENSE

Apache-2.0