josk

Schedule recurring tasks in Node.js and Bun with Redis, MongoDB, or PostgreSQL.

40|4|Updated Dec 28, 2016
One-click install
npx skills add https://github.com/veliovgroup/josk --skill josk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: josk
Source: https://github.com/veliovgroup/josk/tree/main/skills/josk
Command: npx skills add https://github.com/veliovgroup/josk --skill josk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires josk, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the scheduling and execution of recurring tasks across horizontally scaled Node.js and Bun applications, ensuring that tasks are reliably executed even when multiple instances are running.

Core Features & Use Cases

  • Cluster-Wide Scheduling: Distribute task execution across all instances in a cluster, ensuring high availability and fault tolerance.
  • Guaranteed Execution: Ensures that every task runs exactly once, eliminating the risk of duplicate execution.
  • Use Case: Ideal for scenarios like automated reporting, background processing, and periodic maintenance tasks in distributed systems.

Quick Start

Use the josk skill to schedule a task to run every minute, extracting all text from files in the 'logs' directory.

josk setInterval "extractLogs" 60_000

Frequently Asked Questions about josk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I schedule recurring tasks in a Node.js or Bun cluster without duplicate execution?

You can schedule recurring tasks across a Node.js or Bun cluster by using a distributed scheduler that coordinates instances to guarantee at-least-once execution. This ensures tasks run reliably without duplicate execution across horizontally scaled applications.

What is the best way to run periodic background jobs in horizontally scaled applications?

The best way to run periodic background jobs in horizontally scaled applications is using a cluster-wide scheduling mechanism. It distributes task execution across all instances, ensuring high availability and fault tolerance for automated reporting and maintenance tasks.

Does recurring task scheduling work with both Redis and MongoDB storage?

Yes, recurring task scheduling works with Redis, MongoDB, and PostgreSQL for storage and synchronization. You need the appropriate client library to interact with your chosen storage backend and coordinate task execution across application instances.

How do I set up a recurring task to run every minute in Node.js?

To set up a recurring task to run every minute in Node.js, use the scheduling command with the task name and interval in milliseconds. For example, pass the task identifier and 60000 milliseconds to execute the job at one-minute intervals.

When do I need a cluster-wide scheduler instead of a simple cron job?

You need a cluster-wide scheduler instead of a simple cron job when running multiple instances of a Node.js or Bun application. It prevents duplicate task execution by coordinating across instances, which a standalone cron job cannot manage.