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

@go-go-scope/scheduler

v2.9.1

Published

Distributed job scheduler for go-go-scope with unified instance API

Readme

@go-go-scope/scheduler

Distributed job scheduler for go-go-scope with admin + workers architecture

Features

  • Admin + Workers Pattern: Enforced separation between schedule management and execution
  • Schedule Management: Create, update, pause, resume, disable, and delete schedules
  • Schedule States: Active, paused, or disabled states with automatic handling
  • Statistics: Track job success rates, durations, and counts
  • Timezone Support: Full IANA timezone support with DST handling
  • Distributed Locking: Prevents duplicate execution across multiple workers
  • Persistent Storage: Redis, PostgreSQL, MySQL, SQLite support

Installation

npm install go-go-scope @go-go-scope/scheduler

Architecture

The scheduler enforces a clear separation of concerns:

Admin Instance

  • Creates and manages schedules using createSchedule()
  • Stores schedule metadata in persistent storage
  • Typically only one admin runs at a time
  • Handles schedule lifecycle (create, delete, update)

Worker Instances

  • Load schedules from storage using loadSchedules()
  • Provide handler functions for each schedule
  • Execute jobs with distributed locking
  • Multiple workers can run for high availability

Quick Start

1. Admin Instance

import { scope } from "go-go-scope";
import { Scheduler, SchedulerRole, CronPresets } from "@go-go-scope/scheduler";
import { RedisJobStorage } from "@go-go-scope/scheduler";
import { RedisAdapter } from "go-go-scope/persistence/redis";
import Redis from "ioredis";

const redis = new Redis("redis://localhost:6379");
const redisAdapter = new RedisAdapter(redis);

await using s = scope({ persistence: redisAdapter });

const admin = new Scheduler({
  role: SchedulerRole.ADMIN,  // Required!
  scope: s,
  storage: new RedisJobStorage(redis, redisAdapter),
});

// Create schedules - no handler needed here
await admin.createSchedule("daily-report", {
  cron: CronPresets.DAILY,
  timezone: "America/New_York",
  maxRetries: 3,
  timeout: 30000,
});

2. Worker Instance

const worker = new Scheduler({
  role: SchedulerRole.WORKER,  // Required!
  scope: s,
  storage: new RedisJobStorage(redis, redisAdapter),
});

// Load schedules from storage and provide handlers
await worker.loadSchedules({
  handlerFactory: (name, schedule) => {
    switch (name) {
      case "daily-report":
        return async (job, jobScope) => {
          const [err, data] = await jobScope.task(async () => {
            return fetchReportData();
          });
          if (err) throw err;
          await sendReport(data);
        };
      default:
        return null; // Skip unknown schedules
    }
  },
});

worker.start();

API Reference

See the full API documentation for detailed usage.

License

MIT © thelinuxlich