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

@uns-kit/cron

v2.0.45

Published

Cron-driven plugin for UnsProxyProcess that emits UNS events on a schedule.

Readme

@uns-kit/cron

@uns-kit/cron adds cron-style scheduling to the UNS runtime. It registers a createCrontabProxy method on UnsProxyProcess that fires a cronEvent on every tick. Use this to trigger periodic MQTT publishes, data pulls, or any scheduled logic inside your microservice.

Note: Apps built with uns-kit are intended to be managed by the UNS Datahub controller.

uns-kit in context

| Package | Description | | --- | --- | | @uns-kit/core | Base runtime (UnsProxyProcess, MQTT helpers, config tooling, gRPC gateway). | | @uns-kit/api | Express plugin — HTTP endpoints, JWT/JWKS auth, Swagger, UNS metadata. | | @uns-kit/cron | Cron-driven scheduler that emits UNS events on a fixed cadence. | | @uns-kit/cli | CLI for scaffolding new UNS applications. |

Installation

pnpm add @uns-kit/cron
# or
npm install @uns-kit/cron

@uns-kit/core must also be present — the plugin augments UnsProxyProcess.

How it works

  1. Import @uns-kit/cron as a side-effect to register the plugin.
  2. Call proc.createCrontabProxy(schedule, options?) with a cron expression.
  3. Listen to cronEvent — it fires on every tick with the event name and expression.
  4. Inside the handler, publish to MQTT, query a database, call an API — whatever your service needs on that cadence.

Single schedule

import UnsProxyProcess from "@uns-kit/core/uns/uns-proxy-process";
import { ConfigFile } from "@uns-kit/core";
import type { UnsEvents } from "@uns-kit/core";
import "@uns-kit/cron";
import { type UnsProxyProcessWithCron } from "@uns-kit/cron";

const config = await ConfigFile.loadConfig();
const proc = new UnsProxyProcess(config.infra.host!, { processName: config.uns.processName }) as UnsProxyProcessWithCron;

// Fire every 5 minutes
const cron = await proc.createCrontabProxy("*/5 * * * *", { event: "collect" });

cron.event.on("cronEvent", async ({ event, cronExpression }: UnsEvents["cronEvent"]) => {
  // Pull data from a sensor / database and publish to UNS
  const reading = await fetchSensorReading();
  proc.publish("enterprise/site/area/sensor/energy-resource/main/current", { value: reading });
});

Multiple schedules on one proxy

Pass an array of { cronExpression, event } objects to handle different cadences from a single handler:

const cron = await proc.createCrontabProxy([
  { cronExpression: "* * * * * *",   event: "fast-poll" },   // every second
  { cronExpression: "*/10 * * * *",  event: "slow-summary" }, // every 10 minutes
]);

cron.event.on("cronEvent", ({ event }) => {
  if (event === "fast-poll") {
    // lightweight polling
  } else if (event === "slow-summary") {
    // heavier aggregation
  }
});

Multiple schedules with shared options

const cron = await proc.createCrontabProxy(
  ["*/5 * * * *", "0 * * * *"],
  { timezone: "Europe/Ljubljana" },
);

Cron expression reference

| Expression | Meaning | |---|---| | * * * * * * | Every second (6-part with seconds) | | */5 * * * * | Every 5 minutes | | 0 * * * * | Every hour | | 0 6 * * 1-5 | Every weekday at 06:00 |

The underlying scheduler supports both 5-part (minute-level) and 6-part (second-level) cron expressions.

Scripts

pnpm run typecheck
pnpm run build

build emits ESM JavaScript and type declarations into dist/.

License

MIT © Aljoša Vister