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-package

v1.0.1

Published

This module is mainly used to demonstrate task scheduling with an example

Readme

TaskScheduler Class

The TaskScheduler class is designed to handle scheduling of tasks with various options such as delays, intervals, repetitions, and priorities. It provides a robust system for managing and executing scheduled tasks efficiently.

Features:

Task Scheduling: Supports delay, interval, and repetition for tasks. Priority Management: Allows tasks to be sorted and executed based on priority levels. Pause and Resume: Tasks can be paused and resumed as needed. Dynamic Modifications: Provides methods to modify task timings and intervals even after scheduling.

Key Concepts

  1. Task Properties:

name: The name of the task. callback: The function that executes when the task is run. interval: The interval (in milliseconds) at which the task repeats. delay: The initial delay (in milliseconds) before the task starts. repeat: Boolean flag to determine if the task repeats after each interval. priority: The priority level of the task, with higher numbers indicating higher priority.

  1. Task Lifecycle:

Scheduling: Tasks can be scheduled with specific properties. Execution: Tasks are run based on their schedule and priority. Modification: Tasks can be adjusted for intervals, delays, or paused/resumed. Removal: Tasks can be removed either manually or when there are no more pending tasks.

3.Methods:

addTask(taskDetails): Adds a new task with the provided configuration. removeTask(taskId): Removes a task by its unique ID. pauseTask(taskId): Pauses a task, preventing it from running. resumeTask(taskId): Resumes a paused task. adjustTaskInterval(taskId, newInterval): Adjusts the interval of a repeatable task. modifyTaskTime(taskId, { newDelay, newInterval }): Modifies both delay and interval of a task. cancelAllTasks(): Cancels all scheduled tasks.

  1. Internal Handling:

Tasks are sorted based on priority and executed in order.If no tasks are left, the scheduler is stopped.