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

@cronbeats/cronbeats-node

v0.1.5

Published

Cron job monitoring and heartbeat monitoring SDK for Node.js. Monitor scheduled tasks, background jobs, and cron jobs with simple ping telemetry. Get alerts when cron jobs fail, miss their schedule, or run too long.

Downloads

595

Readme

CronBeats Node SDK (Ping)

npm version downloads

Official Node.js SDK for CronBeats ping telemetry.

Install (local/dev)

npm install

SDK API

  • ping()
  • start()
  • end("success" | "fail")
  • success()
  • fail()
  • progress(seqOrOptions, message?)

Quick Usage

import { PingClient } from "./dist/index.js";

const client = new PingClient("abc123de", {
  baseUrl: "https://cronbeats.io",
  timeoutMs: 5000,
  maxRetries: 2,
});

await client.start();
// ...your work...
await client.success();

Progress Tracking

Track your job's progress in real-time. CronBeats supports two distinct modes:

Mode 1: With Percentage (0-100)

Shows a progress bar and your status message on the dashboard.

Use when: You can calculate meaningful progress (e.g., processed 750 of 1000 records)

// Percentage mode: 0-100 with message
await client.progress(50, "Processing batch 500/1000");

// Or using options object
await client.progress({
  seq: 75,
  message: "Almost done - 750/1000",
});

Mode 2: Message Only

Shows only your status message (no percentage bar) on the dashboard.

Use when: Progress isn't measurable or you only want to send status updates

// Message-only mode: null seq, just status updates
await client.progress(null, "Connecting to database...");
await client.progress(null, "Starting data sync...");

What you see on the dashboard

  • Mode 1: Progress bar (0-100%) + your message → "75% - Processing batch 750/1000"
  • Mode 2: Only your status message → "Connecting to database..."

Complete Example

import { PingClient } from "@cronbeats/cronbeats-node";

const client = new PingClient("abc123de");
await client.start();

try {
  // Message-only updates for non-measurable steps
  await client.progress(null, "Connecting to database...");
  const db = await connectToDatabase();
  
  await client.progress(null, "Fetching records...");
  const total = await db.count();
  
  // Percentage updates for measurable progress
  for (let i = 0; i < total; i++) {
    await processRecord(i);
    
    if (i % 100 === 0) {
      const percent = Math.floor((i * 100) / total);
      await client.progress(percent, `Processed ${i} / ${total} records`);
    }
  }
  
  await client.progress(100, "All records processed");
  await client.success();
  
} catch (err) {
  await client.fail();
  throw err;
}

Error Handling

import { ApiError, ValidationError } from "./dist/index.js";

try {
  await client.ping();
} catch (err) {
  if (err instanceof ValidationError) {
    // Invalid local inputs
  } else if (err instanceof ApiError) {
    // API/network issue
    console.log(err.code, err.httpStatus, err.retryable);
  }
}

Notes

  • Uses POST for telemetry requests.
  • jobKey must be exactly 8 Base62 characters.
  • Retries only for network errors, HTTP 429, and HTTP 5xx.
  • Default timeout is 5s to avoid blocking cron jobs.