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

task-scheduler-js

v1.0.3

Published

A simple task scheduler with recurring tasks and pause/resume functionality.

Readme

Simple-chronos-scheduler.js

A simple task scheduler for JavaScript with support for recurring tasks, pause/resume functionality, and task management. This library allows you to schedule tasks with a specified delay, execute them once, or make them recurring. You can also pause and resume tasks as needed.

Features

  • Add one-time tasks: Execute a task after a specified delay.
  • Recurring tasks: Schedule tasks that repeat at regular intervals.
  • Pause tasks: Pause tasks without removing them from the scheduler.
  • Resume tasks: Resume paused tasks from where they left off.
  • Task removal: Remove tasks by their ID.

Installation

To install task-scheduler-js, run the following npm command:

npm install task-scheduler-js

If you're using the package in a Node.js environment or as part of your front-end build, you can import the Scheduler class as follows:

const Scheduler = require('task-scheduler-js');
const sche = new Scheduler();

// Adds a one-time task (executes after 1 second)
const t1 = sche.addTask(() => console.log('Task executed once'), 1000, false);

// Adds a recurring task (executes every 2 seconds)
sche.addTask(() => console.log('Recurring task executed'), 2000, true);

// Pause the recurring task after 5 seconds
setTimeout(() => {
    console.log("Pausing the recurring task...");
    sche.pauseTask(t1.id);  // Assuming task ID 2 is the recurring task
}, 5000);

// Resume the task after 8 seconds
setTimeout(() => {
    console.log("Resuming the recurring task...");
    sche.resumeTask(t1.id);  // Resumes the recurring task
}, 8000);

// Removes the one-time task after 3 seconds
setTimeout(() => {
    console.log("Removing the one-time task...");
    sche.removeTask(t1.id);  // Removes the task with ID 1
}, 3000);