
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
pear-runtime-updater
Advanced tools
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.
This boilerplate is MVP and Experimental.
Example in node.js:
const PearRuntimeUpdater = require('pear-runtime-updater')
const path = require('path')
const Corestore = require('corestore')
const Hyperswarm = require('hyperswarm')
const goodbye = require('graceful-goodbye')
const { version, upgrade } = require('./package.json')
const store = new Corestore('./my-app/corestore')
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
store
})
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)
})
const keyPair = await store.createKeyPair('pear-runtime')
const swarm = new Hyperswarm({ keyPair })
swarm.on('connection', (connection) => store.replicate(connection))
swarm.join(updater.drive.core.discoveryKey, {
client: true,
server: false
})
// handle teardown
goodbye(async () => {
await swarm.destroy()
await updater.close()
await store.close()
})
applyUpdate() to atomic swap the new build (bundled apps; macOS/Linux)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.store - (required) Pass a Corestore to be used for updates.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.nextAfter 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.
Apache-2.0
FAQs
Listens for OTA Pear App updates
We found that pear-runtime-updater demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.