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

@sandsoftwaresolutions/cron-next

v0.1.1

Published

Parse cron expressions and find the next run times, in local time or UTC.

Readme

@sandsoftwaresolutions/cron-next

CI

Read cron expressions and find out when they run next. For scheduling jobs on a Pi, showing "next backup" in a dashboard, or testing a schedule before you deploy it. No dependencies.

Install

npm install @sandsoftwaresolutions/cron-next

Works with import and require(), and ships TypeScript types for both.

Usage

import { nextRun, nextRuns, matches, describe } from "@sandsoftwaresolutions/cron-next";

nextRun("30 6 * * mon-fri");                      // Date: the next weekday at 06:30 (local time)
nextRuns("*/15 9-17 * * *", 3);                   // the next three runs
nextRun("@daily", new Date(), { utc: true });     // in UTC
matches("0 * * * *", new Date());                 // is it the top of the hour?
describe("*/10 * * * *");                         // "every 10 minutes"

Syntax

Five fields: minute hour day-of-month month weekday.

| Field | Values | | --- | --- | | minute | 0-59 | | hour | 0-23 | | day of month | 1-31 | | month | 1-12 or jan-dec | | weekday | 0-7 (0 and 7 are Sunday) or sun-sat |

Each field takes *, a number, a list (1,15), a range (9-17), and steps (*/15, 10-40/10, 5/20). Aliases: @hourly, @daily (@midnight), @weekly, @monthly, @yearly (@annually).

Details that matter

  • nextRun is the first matching minute strictly after from. Seconds are ignored.
  • Day and weekday together mean "either", as in classic cron: 0 0 13 * fri is every 13th and every Friday. A field that starts with * (also */2 or *,5) counts as not restricted, so 0 0 */2 * fri means "every second day and a Friday".
  • Local time or UTC. Local is the default. In local time a time that does not exist (the clock jumps forward) does not run, and a time that happens twice (the clock goes back) runs twice. Use { utc: true } for schedules that must not move.
  • Impossible dates (0 0 30 2 *) give null after looking nine years ahead (the longest gap between two 29 Februaries is eight).
  • A bad expression throws a SyntaxError or RangeError that says which field is wrong.

This package finds the times; it does not run anything. Combine it with a setTimeout loop, or let the system cron do the running.