Skip to main content

@coven/cron@0.3.3
Built and signed on GitHub Actions

⏳ Fantastic cron parser and constructor.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (0.3.3)
v
ALL_TOKEN

Token that represents "all" in a cron expression.

T
AllToken

Type to represent the "all" token ("*").

f
compareField

Checks if given value is included in given field.

f
compareRangeOrValue

Compares value to a ValueOrRangeField.

T
CronObject

Object that represents the 5 cron expression fields.

v
cronRegExp

Regular expression to test for valid cron expressions.

T
CronString

String cron expression (5 fields separated by spaces).

f
dateInCron

Check if given cron expression object includes given date.

v
DAY_OF_MONTH_NAME

Name of a day of month field in the object representation of a cron expression.

v
DAY_OF_WEEK_NAME

Name of a day of week field in the object representation of a cron expression.

T
Field

Union of AllToken, ValueOrRangeField and ListField that represents a field in a cron expression.

v
fieldNamesTuple

Field names in order.

f
fieldRegExp

Regular expression to match a cron expression field.

T
FieldString

Union of AllToken, ValueOrRangeString and ListString that represents a field in a cron expression.

v
FROM_NAME

Range field from name.

v
HOUR_NAME

Name of a hour field in the object representation of a cron expression.

f
isAllToken

Predicate to check if the given value is "*".

f
isListField

Predicate checking if given value is a ListField.

f
isListString

Predicate checking if given value is a ListString.

f
isNumberString

Predicate checking if given value is a number.

f
isRangeField

Predicate checking if given value is a cron object range (RangeField).

f
isRangeString

Predicate checking if given value is a cron string range (RangeString).

f
isValidExpression

Validates if a string is a cron expression.

v
LIST_EXPRESSION_SEPARATOR_TOKEN

Token to separate list items in a cron expression.

T
ListExpressionSeparatorToken

Type to represent the "list expression separator" token (",").

T
ListField

Type that represents a list of values for a cron object field.

T
ListString

Type that represents a list of values for a cron string field.

v
MINUTE_NAME

Name of a minute field in the object representation of a cron expression.

v
MONTH_NAME

Name of a month field in the object representation of a cron expression.

T
MonthValue

Type that represents values from 1 to 12 for the month cron field.

f
nextDate

Get next ISO date string for the given date and the given cron expression.

f
nextDates

Get next ISO date iterator for the given date and the given cron expression.

f
normalizeAliases

Normalizes day and month 3 letter aliases into their number counterparts.

v
normalizeMap

Map from 3 letter aliases to their respective number representations.

f
paddedRegExp

Regular expression to match field with an optional 0 to it's left.

f
parse

Parses a cron expression into an object representation.

f
parseField

Parses a cron field.

f
parseFieldTuplesMap

Given an iterable of tuples with the name of a field and a field value, run each field through parseField.

f
parseList

Parses a cron list into an array.

f
parseListMap

Map to parse cron list items (can be either a range or a number).

f
parseNumber

Parses a cron list into an array.

f
parseNumberMap

Maps given iterable through parseNumber.

f
parseNumberTest

Matches only valid number values for a cron expression (from 0 or 00 to 59).

f
parseRange

Parses a cron range into an object.

v
RANGE_EXPRESSION_SEPARATOR_TOKEN

Token to separate range values in a cron expression.

T
RangeExpressionSeparatorToken

Type to represent the "range expression separator" token ("-").

T
RangeField

Type that represents a range of values for a cron object field.

T
RangeString

Type that represents a range of values for a cron string field.

f
rangeStringTest

Regular expression to test if given string is a range.

f
stringify

Takes a cron object and returns a sting expression.

f
stringifyField

Takes a cron object and returns a string expression.

f
stringifyList

Turns cron list into a string.

f
stringifyRange

Turn a cron range into a string.

v
TO_NAME

Range field to name.

f
valueOrListRegExp

Regular expression to match lists.

T
ValueOrRangeField

Union of a set of numbers and a RangeField with that same set of numbers.

f
valueOrRangeRegExp

Regular expression to match values or ranges.

T
ValueOrRangeString

Union of a set any number and a RangeString.

f
valueRangeOrListRegExp

Regular expression to match values, ranges or lists.

f
zipRangeNames

Zips "from" and "to".