JSPM

@cronbeats/cronbeats-node

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 56
  • Score
    100M100P100Q59062F
  • License MIT

Official CronBeats Ping SDK for Node.js

Package Exports

  • @cronbeats/cronbeats-node
  • @cronbeats/cronbeats-node/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cronbeats/cronbeats-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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 Examples

await client.progress(50, "Processing batch 50/100");

await client.progress({
  seq: 75,
  message: "Almost done",
});

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.