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

naughty-scheduler

v0.4.3

Published

Node js scheduler

Readme

Naughty Scheduler

license snyk npm version NPM Downloads NPM Downloads

Usage

  • Install: npm install naughty-scheduler
  • Require: const utils = require('naughty-scheduler')

Job

  const print = console.log.bind(null, "Hello");
  const job_world = new Job(print, {time: "2025-10-11", params: [" World!"]});
  const job_me = new Job(print, {time: Date.now(), params: [" new ME!"], tag: "me"});
  const job_hello = new Job(print); // time 0;
  job.verbalDate("10m"); // Date.now() + 10 * 60 * 1000
  const job_you = new Job(print, {time: 1000, params: [" You O:"]});
  job_you.verbalTime("1d"); // 24 * 60 * 60 * 1000;
  const job_kind = new Job(print, {time: 1000, params: [" You O:"], kind: "every"});

Scheduler

const print = console.log.bind(null, "Hello");
const scheduler = new Scheduler();

const job_kind = new Job(print, {time: 1000, kind: "every"});
scheduler.add(job_kind);
// kind has been already set to "every", so scheduler is gonna fire callback every 1s.

const job_world = new Job(print, {time: "2025-10-11", params: [" World!"]});
scheduler.once(job_world);
// scheduler will fire callback in 2025 10 11 in 00:00 once.

const job_you = new Job(print, {time: 1000, params: [" You O:"]});
job_you.verbalTime("1d");
scheduler.every(job_you);
// scheduler will fire callback every 1day from now.

scheduler.fire(job_you);
// callback will fire callback immediately and and keep job waiting it time.
 
scheduler.fire(job_you, true);
// callback will fire callback immediately and remove job form the queue.

job_hello.setDate("2026-01-17T21:00:00.000Z");
scheduler.reschedule(job_hello, "once");
// To reschedule we change the time in job and reassign it with "once".
// Basically works like this:
// 1. We changed time in job and call scheduler.reschedule.
// 2. scheduler will remove callback from queue and job from dataset.
// 3. scheduler will add job and callback back with updated information.

job_hello.setDate("2026-01-17T00:00:00.000Z");
scheduler.reschedule(job_hello);
// Here we changed time again and reschedule job "job_hello" again.
// We didn't provide second param "kind" so the kind of the job will be as previous (once).

scheduler.cancel(job_world);
// scheduler will cancel provided job.

scheduler.cancelAll();
// scheduler cancels all the jobs.

const array_of_jobs = scheduler.stop();
// scheduler cancels all the jobs and returns array of all jobs weren't called.

const me = scheduler.find("me");
// finds job by it tag.

for(const job of scheduler){
  console.log(job);
}
// scheduler iterates jobs collection.

scheduler.pipe([
  new Job(print, {time: 2000, kind: "every"}),
  new Job(print, {time: "2025-12-12", kind: "once"}),
]); 
// scheduler will add all the jobs from iterable with provided "kind" field.

scheduler.on("fire", console.log)
// subscribe to scheduler events
// event list: "fire", "cancel", "cancelAll", "add", "stop"
// Also you can find all the event by using static field "Scheduler.kinds"

Part of naughty stack