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

@nodeboot/starter-scheduler

v1.6.6

Published

Node-Boot starter package for schedulers

Readme

📆 @nodeboot/starter-scheduler – Node-Boot Scheduling Starter

Overview

The @nodeboot/starter-scheduler package provides a simple yet powerful mechanism to schedule jobs within a Node-Boot application, similar to how Spring Boot Scheduler works.

It leverages node-cron under the hood to execute scheduled tasks at specified intervals based on cron expressions.

With minimal configuration, developers can automatically trigger functions within beans using the @Scheduler decorator.


✨ Features

Annotation-based scheduling – Just add @Scheduler(cronExpression) to any bean method. ✅ Cron-based execution – Supports flexible scheduling using cron expressions.
Lifecycle-aware – Scheduling starts when the application initializes.
Minimal setup – Requires only @EnableScheduling to activate.


🚀 Installation

Ensure you have Node-Boot installed in your project. Then, install the scheduler starter package:

pnpm add @nodeboot/starter-scheduler

🔥 Usage

1️⃣ Enable Scheduling in Your Application

To activate the scheduling system, add @EnableScheduling() to your application class:

import {EnableScheduling} from "@nodeboot/starter-scheduler";
import {NodeBootApplication, NodeBoot, ExpressServer} from "@nodeboot/core";

@EnableScheduling()
@NodeBootApplication()
export class SampleApp implements NodeBootApp {
    start(): Promise<NodeBootAppView> {
        return NodeBoot.run(ExpressServer);
    }
}

2️⃣ Schedule Jobs Using @Scheduler

To schedule a method to run at a specific interval, add the @Scheduler decorator to a method inside a bean (@Service, @Component, etc.).

The method will automatically run based on the cron expression provided.

Example: Run a Task Every Minute

import {Scheduler} from "@nodeboot/starter-scheduler";
import {Service} from "@nodeboot/core";

@Service()
export class TaskService {
    @Scheduler("* * * * *") // Runs every minute
    public logMessage() {
        console.log(`Task executed at: ${new Date().toISOString()}`);
    }
}

✅ This will log a message every minute! 🕒


3️⃣ Understanding Cron Expressions

The @Scheduler decorator follows standard cron syntax:

*    *    *    *    *
│    │    │    │    │
│    │    │    │    └── Day of the Week (0-6, Sunday = 0)
│    │    │    └──── Month (1-12)
│    │    └─────── Day of the Month (1-31)
│    └────────── Hour (0-23)
└──────────── Minute (0-59)

| Expression | Meaning | | --------------- | --------------------------------- | | "* * * * *" | Runs every minute | | "0 * * * *" | Runs every hour (at 0 min) | | "0 0 * * *" | Runs daily at midnight | | "0 0 * * 1" | Runs every Monday at midnight | | "*/5 * * * *" | Runs every 5 minutes |

For more advanced cron expressions, refer to node-cron documentation.


🛠️ How It Works Internally

🔹 @Scheduler(cronExpression: string)

This decorator:

  • Registers the method as a scheduled job.
  • Uses the Adapter Pattern to integrate with the Node-Boot lifecycle.
  • Triggers execution based on the cron expression.

🔹 @EnableScheduling()

  • Enables automatic scheduling in the application.
  • Registers the Scheduler Adapter into the Node-Boot lifecycle.
  • Ensures all @Scheduler jobs are scheduled at startup.

🎯 Example: Sending Notifications Every Hour

Imagine you need to send notifications to users every hour. You can achieve this with:

import {Scheduler} from "@nodeboot/starter-scheduler";
import {Service} from "@nodeboot/core";

@Service()
export class NotificationService {
    @Scheduler("0 * * * *") // Runs at the start of every hour
    public sendNotifications() {
        console.log(`📢 Sending notifications to users at ${new Date().toISOString()}`);
    }
}

🔔 This will trigger notifications every hour, automatically!


⚠️ Common Issues & Debugging

@Scheduler Not Running?

✔️ Ensure @EnableScheduling() is added to your application class.
✔️ Verify the cron expression is correct.
✔️ Check the logs to see if the scheduler is registered.


📚 Additional Resources


🎉 Conclusion

The @nodeboot/starter-scheduler package makes scheduling effortless and declarative within Node-Boot applications.

By simply adding @Scheduler(cronExpression), you can automate periodic tasks, without manually managing timers.

Happy scheduling! 🚀🎯