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

sked

v0.1.2

Published

Scheduler based in javascript Timeouts and Intervals

Readme

sked

Scheduler based in Javascript timers

Installation

$ node install --save sked

Usage

The constructor accepts 3 arguments: config, callback and context.

Use https://github.com/guille/ms.js/ for times if you want.

var sked = require('sked');

var config = {
  start: { date, string or ms },
  period: { ms or string }
};

var context = this;

var scheduler = sked(config, function() {
  // do stuff
  ...
  // if you want to stop the execution:
  scheduler.stop();
}, context);

if you don't pass a context, it will be the scheduler itself

sked(config, function() {
  // do stuff
  if (something) this.stop();
});

There is a start method that can be accessed using sked as a constructor. If you pass true to this method it will execute now (synchronously) in case the start time is not 0 or now.

var Sked = require('sked');
var scheduler = new Sked(config, function() {});
scheduler.start(true); // will do now

Config options

You can skip the options and by default they will became:

{ period: '1d', start: 'now' }

So this will work once a day from now:

var scheduler = sked(function() {
// do stuff
});

start:

start can be omitted and will became now:

var config = { period: '1d' };
// will became
var config = { start: 'now', period: '1d' };
// which is equivalent to
var config = '1d';

start can be a date:

var config = { start: new Date('2017-04-15T18:06:08-07:00'), period:... };

or a string:

// start one minute in the future
var config = { start: '1m', period:... };

or milliseconds:

// start one minute in the future
var config = { start: 60000, period:... };

period:

If period is omitted, will run only once, but for that purpose you better use just a setTimeout unless you are passing a Date instance

// execute once after a second
var config = { start: 1000 };

A string or an integer instead of an object will be interpreted

// this works
var config = '1m';
// also this
var config = 60000;

preRun:

Default false. It's equivalent to passing true to the start method skedInstance.start(true).