Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @vangware/cron with all npm packages installed. Try it out:

var cron = require("@vangware/cron")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@vangware/cron v4.0.3

Cron expression parser

@vangware/cron logo

Build Status License NPM Version Open Issues Size

Cron Quartz and Cron UNIX expression parser.

Usage

📦 Node

import { parseStringQuartz, parseCronQuartz } from "@vangware/cron";

const cron = parseStringQuartz("1-2/3 1-2,3,4 * 2W SEP,OCT 1L */10");
/*
{
    seconds: { every: 3, start: { from: 1, to: 2 } },
    minutes: [{ from: 1, to: 2 }, 3, 4],
    hours: "*",
    dayOfMonth: { nearest: 2 },
    month: ["SEP", "OCT"],
    dayOfWeek: { last: 1 },
    year: { every: 10, start: "*" }
}
*/

parseCronQuartz(cron); // "1-2/3 1-2,3,4 * 2W SEP,OCT 1L */10"

🦕 Deno

import { parseStringQuartz, parseCronQuartz } from "https://cdn.skypack.dev/@vangware/cron";

const cron = parseStringQuartz("1-2/3 1-2,3,4 * 2W SEP,OCT 1L */10");
/*
{
    seconds: { every: 3, start: { from: 1, to: 2 } },
    minutes: [{ from: 1, to: 2 }, 3, 4],
    hours: "*",
    dayOfMonth: { nearest: 2 },
    month: ["SEP", "OCT"],
    dayOfWeek: { last: 1 },
    year: { every: 10, start: "*" }
}
*/

parseCronQuartz(cron); // "1-2/3 1-2,3,4 * 2W SEP,OCT 1L */10"
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free