Modules@robinpath/cron

@robinpath/cron

0.1.0Public

Cron expression parsing, validation, scheduling, and human-readable descriptions

@robinpath/cron

Cron expression parsing, validation, scheduling, and human-readable descriptions

Category Functions Auth License

Why use this module?

The cron module lets you:

  • Validate a cron expression
  • Parse cron expression into expanded fields
  • Get next occurrence after a date
  • Get next N occurrences
  • Get previous occurrence before a date

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/cron

Quick Start

No credentials needed — start using it right away:

cron.parse "0 9 * * 1-5"

Available Functions

FunctionDescription
cron.isValidValidate a cron expression
cron.parseParse cron expression into expanded fields
cron.nextGet next occurrence after a date
cron.nextNGet next N occurrences
cron.prevGet previous occurrence before a date
cron.matchesCheck if a date matches a cron expression
cron.describeHuman-readable description of a cron expression
cron.betweenGet all occurrences between two dates

Examples

Parse cron expression into expanded fields

cron.parse "0 9 * * 1-5"

Get next occurrence after a date

cron.next "*/5 * * * *"

Get next N occurrences

cron.nextN "0 * * * *" 10

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/cron";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  cron.parse "0 9 * * 1-5"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/cron
Version0.1.0
LicenseMIT
Unpacked Size4.5 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

devops