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

@fleetforgeio/ota

v0.1.0

Published

Over-The-Air update system for FleetForge - Delta updates, deployment strategies, and rollback

Downloads

59

Readme

@fleetforge/ota

Over-The-Air (OTA) update system for FleetForge IoT platform.

Features

🚀 Delta Updates

  • Binary Diff/Patch Algorithm: Minimize bandwidth usage by sending only the differences between firmware versions
  • Compression Support: gzip and brotli compression for optimal transfer size
  • Integrity Verification: SHA-256/SHA-512 checksums for patch validation
  • Bandwidth Savings: Up to 90% reduction in update size for incremental changes

📊 Deployment Strategies

Canary Deployment

Deploy to a small percentage of devices first, then gradually roll out to the entire fleet.

import { CanaryDeploymentExecutor } from '@fleetforge/ota';

const executor = new CanaryDeploymentExecutor();
const deployment = await executor.execute(devices, updatePackage, {
  strategy: DeploymentStrategy.CANARY,
  canaryPercentage: 10,
  healthCheckInterval: 5000,
  maxFailureRate: 0.1,
  autoRollback: true,
});

Rolling Deployment

Deploy in batches with configurable size and delay between batches.

import { RollingDeploymentExecutor } from '@fleetforge/ota';

const executor = new RollingDeploymentExecutor();
const deployment = await executor.execute(devices, updatePackage, {
  strategy: DeploymentStrategy.ROLLING,
  batchSize: 50,
  batchDelay: 10000,
  maxFailureRate: 0.2,
  autoRollback: true,
});

Blue-Green Deployment

Download to all devices first, then switch atomically.

import { BlueGreenDeploymentExecutor } from '@fleetforge/ota';

const executor = new BlueGreenDeploymentExecutor();
const deployment = await executor.execute(devices, updatePackage, {
  strategy: DeploymentStrategy.BLUE_GREEN,
  healthCheckInterval: 5000,
  maxFailureRate: 0.05,
  autoRollback: true,
});

🔄 Automatic Rollback

  • Failure Detection: Monitor deployment health and failure rates
  • Automatic Revert: Roll back to Last Known Good (LKG) version on failure
  • Retry Logic: Configurable retry attempts with exponential backoff
  • User Data Preservation: Option to preserve user data during rollback
import { RollbackService } from '@fleetforge/ota';

const rollbackService = new RollbackService();

// Create backup before update
await rollbackService.createBackup(deviceId, currentFirmware);

// Rollback if needed
const success = await rollbackService.rollbackDevice(
  deviceId,
  deviceStatus,
  {
    enabled: true,
    maxRetries: 3,
    retryDelay: 5000,
    preserveUserData: true,
    notifyOnRollback: true,
  },
  RollbackReason.INSTALLATION_FAILED,
);

Installation

npm install @fleetforge/ota

Usage

Delta Update Generation

import { DeltaUpdateEngine } from '@fleetforge/ota';

const engine = new DeltaUpdateEngine();

// Generate delta patch
const patch = await engine.generateDelta(
  sourceBuffer,
  targetBuffer,
  {
    compressionAlgorithm: 'gzip',
    compressionLevel: 6,
    blockSize: 4096,
    checksumAlgorithm: 'sha256',
  }
);

// Apply delta patch
const result = await engine.applyDelta(sourceBuffer, patch);

if (result.success) {
  console.log(`Update applied successfully: ${result.checksum}`);
} else {
  console.error(`Update failed: ${result.error}`);
}

// Calculate bandwidth savings
const savings = engine.calculateSavings(fullSize, patch.patchSize);
console.log(`Saved ${savings.savedPercentage}% bandwidth`);

Deployment Management

import { CanaryDeploymentExecutor } from '@fleetforge/ota';

const executor = new CanaryDeploymentExecutor();

// Start deployment
const deployment = await executor.execute(devices, updatePackage, config);

// Monitor progress
const progress = executor.getProgress(deployment.deploymentId);
console.log(`Progress: ${progress.successCount}/${progress.totalDevices}`);

// Pause deployment
await executor.pause(deployment.deploymentId);

// Resume deployment
await executor.resume(deployment.deploymentId);

// Rollback deployment
await executor.rollback(deployment.deploymentId);

Architecture

Delta Update Engine

  • Binary diff/patch algorithm for efficient updates
  • Multiple compression algorithms (gzip, brotli)
  • Cryptographic verification (SHA-256, SHA-512)

Deployment Executors

  • Base Executor: Abstract class with common functionality
  • Canary Executor: Gradual rollout with health checks
  • Rolling Executor: Batch-based deployment
  • Blue-Green Executor: Atomic switch deployment

Rollback Service

  • Automatic failure detection
  • Version backup and restoration
  • Rollback history tracking
  • Notification system

Testing

# Run tests
nx test ota

# Run tests with coverage
nx test ota --coverage

License

MIT