Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/harrisiirak/cron-parser
/ functions
Functions
184 in github.com/harrisiirak/cron-parser
⨍
Functions
184
◇
Types & classes
35
↓ 212 callers
Method
next
* Find the next scheduled date based on the cron expression. * @returns {CronDate} - The next scheduled date or an ES6 compatible iterator object.
src/CronExpression.ts:225
↓ 170 callers
Method
parse
* Parses a cron expression and returns a CronExpression object. * @param {string} expression - The cron expression to parse. * @param {CronExpre
src/CronExpressionParser.ts:93
↓ 167 callers
Method
getDate
* Returns the day. * @returns {number}
src/CronDate.ts:260
↓ 121 callers
Method
getHours
* Returns the hour. * @returns {number}
src/CronDate.ts:293
↓ 94 callers
Method
getMinutes
* Returns the minutes. * @returns {number}
src/CronDate.ts:301
↓ 66 callers
Method
getMonth
* Returns the month. * @returns {number}
src/CronDate.ts:285
↓ 63 callers
Method
toISOString
* Returns the UTC milliseconds. * @returns {string | null}
src/CronDate.ts:414
↓ 53 callers
Method
stringify
* Generate a string representation of the cron expression. * @param {boolean} [includeSeconds=false] - Whether to include the seconds field in the
src/CronExpression.ts:323
↓ 44 callers
Method
getSeconds
* Returns the seconds. * @returns {number}
src/CronDate.ts:309
↓ 36 callers
Method
getFullYear
* Returns the year. * @returns {number}
src/CronDate.ts:268
↓ 32 callers
Method
getDay
* Returns the day of the week. * @returns {number}
src/CronDate.ts:276
↓ 27 callers
Method
prev
* Find the previous scheduled date based on the cron expression. * @returns {CronDate} - The previous scheduled date or an ES6 compatible iterator
src/CronExpression.ts:235
↓ 24 callers
Method
fieldsToExpression
* Converts cron fields back to a CronExpression instance. * * @public * @param {Record<string, number[]>} fields - The input cron fields obje
src/CronExpression.ts:86
↓ 24 callers
Method
toString
* Returns the date as a string. * @returns {string}
src/CronDate.ts:494
↓ 21 callers
Method
toDate
* Returns the date as a Date object. * @returns {Date}
src/CronDate.ts:502
↓ 14 callers
Method
includesDate
* Check if the cron expression includes the given date * @param {Date|CronDate} date * @returns {boolean}
src/CronExpression.ts:332
↓ 13 callers
Method
compactField
* Returns a string representation of the cron fields. * @param {(number | CronChars)[]} input - The cron fields values * @static * @returns {
src/CronFieldCollection.ts:232
↓ 13 callers
Method
take
* Iterate over a specified number of steps and optionally execute a callback function for each step. * @param {number} steps - The number of steps
src/CronExpression.ts:284
↓ 12 callers
Method
hasNext
* Check if there is a next scheduled date based on the current date and cron expression. * @returns {boolean} - Returns true if there is a next sch
src/CronExpression.ts:245
↓ 10 callers
Method
getTime
* Returns the time. * @returns {number}
src/CronDate.ts:349
↓ 9 callers
Method
applyDateOperation
* Primarily for internal use. * @param {DateMathOp} op - The operation to perform. * @param {TimeUnit} unit - The unit of time to use. * @par
src/CronDate.ts:549
↓ 9 callers
Method
from
* Creates a new CronFieldCollection instance by partially overriding fields from an existing one. * @param {CronFieldCollection} base - The base Cr
src/CronFieldCollection.ts:87
↓ 8 callers
Method
reset
* Reset the iterators current date to a new date or the initial date. * @param {Date | CronDate} [newDate] - Optional new date to reset to. If not
src/CronExpression.ts:312
↓ 7 callers
Method
#getUTC
* Returns the UTC date. * @private * @returns {DateTime}
src/CronDate.ts:576
↓ 7 callers
Method
#matchSchedule
* Checks if the given value matches any element in the sequence. * * @param {number} value - The value to be matched. * @param {number[]} seq
src/CronExpression.ts:99
↓ 7 callers
Method
addMinute
* Adds one minute to the current CronDate.
src/CronDate.ts:138
↓ 7 callers
Method
addUnit
* Adds a unit of time to the current CronDate. * @param {TimeUnit} unit
src/CronDate.ts:200
↓ 7 callers
Method
subtractUnit
* Subtracts a unit of time from the current CronDate. * @param {TimeUnit} unit
src/CronDate.ts:221
↓ 6 callers
Method
#getMinOrMax
* Returns the minimum or maximum value from the given array of numbers. * * @param {number[]} values - An array of numbers. * @param {boolean
src/CronExpression.ts:110
↓ 6 callers
Method
#parseField
* Parse a field from a cron expression. * @param {CronUnit} field - The field to parse. * @param {string} value - The value of the field. * @
src/CronExpressionParser.ts:187
↓ 6 callers
Method
resolveField
* Resolves a field value, either using the provided CronField instance or creating a new one from raw values. * @param constructor - The constructo
src/CronFieldCollection.ts:106
↓ 6 callers
Method
setSeconds
* Sets the seconds. * @param s
src/CronDate.ts:478
↓ 6 callers
Method
stringifyField
* Returns a string representation of the cron fields. * @param {CronField} field - The cron field to stringify * @static * @returns {string}
src/CronFieldCollection.ts:383
↓ 5 callers
Method
#findSchedule
* Finds the next or previous schedule based on the cron expression. * * @param {boolean} [reverse=false] - If true, finds the previous schedule;
src/CronExpression.ts:512
↓ 5 callers
Function
createInterval
(pattern: string)
tests/CronExpression.test.ts:623
↓ 5 callers
Method
isLastWeekdayOfMonth
* Returns true if the day is the last weekday of the month. * @returns {boolean}
src/CronDate.ts:527
↓ 4 callers
Method
addYear
* Adds one year to the current CronDate.
src/CronDate.ts:110
↓ 4 callers
Function
formatOps
(opsPerSecond: number)
benchmarks/runner.ts:55
↓ 4 callers
Function
formatPercentage
(value: number)
benchmarks/runner.ts:71
↓ 4 callers
Function
runBenchmark
( expression: string, currentDate: Date, parser: ParseExpressionFn, iterations: number, )
benchmarks/runner.ts:214
↓ 4 callers
Function
seededRandom
(str?: string)
src/utils/random.ts:39
↓ 4 callers
Method
setMinutes
* Sets the minutes. * @param m
src/CronDate.ts:470
↓ 3 callers
Method
addDay
* Adds one day to the current CronDate.
src/CronDate.ts:124
↓ 3 callers
Method
addHour
* Adds one hour to the current CronDate.
src/CronDate.ts:131
↓ 3 callers
Method
addMonth
* Adds one month to the current CronDate.
src/CronDate.ts:117
↓ 3 callers
Method
addSecond
* Adds one second to the current CronDate.
src/CronDate.ts:145
↓ 3 callers
Method
getUTCDay
* Returns the UTC day of the week. * @returns {number}
src/CronDate.ts:373
↓ 3 callers
Method
hasPrev
* Check if there is a previous scheduled date based on the current date and cron expression. * @returns {boolean} - Returns true if there is a prev
src/CronExpression.ts:264
↓ 3 callers
Method
invokeDateOperation
* Handles a math operation. * @param {DateMathOp} verb - {'add' | 'subtract'} * @param {TimeUnit} unit - {'year' | 'month' | 'day' | 'hour' | 'm
src/CronDate.ts:243
↓ 3 callers
Method
parseFileSync
* Parse a crontab file synchronously * @param filePath Path to crontab file * @returns Parse results * @throws If file cannot be read
src/CronFileParser.ts:32
↓ 3 callers
Method
subtractDay
* Subtracts one day from the current CronDate. * If the day is 1, it will subtract one month instead.
src/CronDate.ts:168
↓ 3 callers
Method
subtractHour
* Subtracts one hour from the current CronDate. * If the hour is 0, it will subtract one day instead.
src/CronDate.ts:176
↓ 3 callers
Method
subtractMinute
* Subtracts one minute from the current CronDate. * If the minute is 0, it will subtract one hour instead.
src/CronDate.ts:184
↓ 3 callers
Method
subtractSecond
* Subtracts one second from the current CronDate. * If the second is 0, it will subtract one minute instead.
src/CronDate.ts:192
↓ 3 callers
Method
subtractYear
* Subtracts one year from the current CronDate.
src/CronDate.ts:152
↓ 2 callers
Method
#isLeapYear
* Determines if the given year is a leap year. * @param {number} year - The year to check * @returns {boolean} - True if the year is a leap year
src/CronDate.ts:71
↓ 2 callers
Method
#matchDayOfMonth
* Determines if the given date matches the cron expression's day of month and day of week fields. * * The function checks the following rules:
src/CronExpression.ts:384
↓ 2 callers
Method
#parseContent
* Internal method to parse crontab file content * @private
src/CronFileParser.ts:43
↓ 2 callers
Method
#parseRange
* Parse a range from a cron expression. * @param {CronUnit} field - The field to parse. * @param {string} val - The range to parse. * @param
src/CronExpressionParser.ts:414
↓ 2 callers
Function
calculateStats
(times: number[])
benchmarks/runner.ts:41
↓ 2 callers
Function
formatTime
(ms: number)
benchmarks/runner.ts:51
↓ 2 callers
Function
getChangeIndicator
(percentChange: number)
benchmarks/runner.ts:62
↓ 2 callers
Method
getMilliseconds
* Returns the milliseconds. * @returns {number}
src/CronDate.ts:317
↓ 2 callers
Method
getUTCDate
* Returns the UTC day. * @returns {number}
src/CronDate.ts:357
↓ 2 callers
Method
getUTCOffset
* Returns the timezone offset from UTC in minutes (e.g. UTC+2 => 120). * Useful for detecting DST transition days. * * @returns {number} UTC
src/CronDate.ts:327
↓ 2 callers
Method
getVersionDir
(version: string)
benchmarks/version-manager.ts:19
↓ 2 callers
Function
initializeBenchmark
(version?: string)
benchmarks/runner.ts:26
↓ 2 callers
Method
max
()
src/fields/CronHour.ts:18
↓ 2 callers
Function
parseAndBenchMarkExpression
( expression: string, iterations = 10000, samples = 5, outputFile: string, )
benchmarks/runner.ts:230
↓ 2 callers
Method
parseFile
* Parse a crontab file asynchronously * @param filePath Path to crontab file * @returns Promise resolving to parse results * @throws If file
src/CronFileParser.ts:20
↓ 2 callers
Method
serialize
* Returns a serialized representation of the cron fields values. * @returns {SerializedCronFields} An object containing the cron field values
src/CronFieldCollection.ts:439
↓ 2 callers
Method
setHours
* Sets the hour. * @param h
src/CronDate.ts:462
↓ 1 callers
Method
#checkDstTransition
* Checks whether the given date falls on a DST transition day in its timezone. * * This is used to disable certain “direct set” fast paths on DS
src/CronExpression.ts:125
↓ 1 callers
Method
#createRange
* Create a range from a cron expression. * @param {CronUnit} field - The field to parse. * @param {number} min - The minimum value of the range.
src/CronExpressionParser.ts:392
↓ 1 callers
Method
#getRawFields
* Get the raw fields from a cron expression. * @param {string} expression - The cron expression to parse. * @param {boolean} strict - If true, w
src/CronExpressionParser.ts:159
↓ 1 callers
Method
#handleMultipleRanges
* Handles multiple ranges. * @param {FieldRange} range {start: number, end: number, step: number, count: number} The range to handle. * @param {
src/CronFieldCollection.ts:341
↓ 1 callers
Method
#handleSingleRange
* Handles a single range. * @param {CronField} field - The cron field to stringify * @param {FieldRange} range {start: number, end: number, step
src/CronFieldCollection.ts:320
↓ 1 callers
Method
#isLastWeekdayOfMonthMatch
* Determines if the current date matches the last specified weekday of the month. * * @param {Array<(number|string)>} expressions - An array of
src/CronExpression.ts:205
↓ 1 callers
Method
#isValidConstraintChar
* Checks if a character is valid for a field. * @param {CronConstraints} constraints - The constraints for the field. * @param {string | number}
src/CronExpressionParser.ts:463
↓ 1 callers
Method
#matchHour
* Determines if the current hour matches the cron expression. * * @param {CronDate} currentDate - The current date object. * @param {DateMath
src/CronExpression.ts:427
↓ 1 callers
Method
#moveToNextMinute
* Moves the date to the next/previous allowed minute value and resets seconds to the min/max allowed. * If there is no remaining allowed minute wit
src/CronExpression.ts:177
↓ 1 callers
Method
#moveToNextSecond
* Moves the date to the next/previous allowed second value. If there is no remaining allowed second * within the current minute, rolls to the next/
src/CronExpression.ts:152
↓ 1 callers
Method
#parseEntry
* Parse a single crontab entry * @private
src/CronFileParser.ts:79
↓ 1 callers
Method
#parseHashed
* Parse a hashed value from a cron expression. * @param {string} value - The value to parse. * @param {CronConstraints} constraints - The constr
src/CronExpressionParser.ts:227
↓ 1 callers
Method
#parseNthDay
* Parse a cron expression. * @param {string} val - The cron expression to parse. * @private * @returns {string} The parsed cron expression.
src/CronExpressionParser.ts:438
↓ 1 callers
Method
#parseRepeat
* Parse repeat from a cron expression. * @param {CronUnit} field - The field to parse. * @param {string} val - The repeat to parse. * @param
src/CronExpressionParser.ts:336
↓ 1 callers
Method
#parseSequence
* Parse a sequence from a cron expression. * @param {CronUnit} field - The field to parse. * @param {string} val - The sequence to parse. * @
src/CronExpressionParser.ts:297
↓ 1 callers
Method
#parseWildcard
* Parse a wildcard from a cron expression. * @param {string} value - The value to parse. * @param {CronConstraints} constraints - The constraint
src/CronExpressionParser.ts:216
↓ 1 callers
Method
#validateRange
* Validate a cron range. * @param {number} min - The minimum value of the range. * @param {number} max - The maximum value of the range. * @p
src/CronExpressionParser.ts:360
↓ 1 callers
Method
#validateRepeatInterval
* Validate a cron repeat interval. * @param {number} repeatInterval - The repeat interval to validate. * @private * @returns {void} * @thr
src/CronExpressionParser.ts:377
↓ 1 callers
Method
#validateTimeSpan
* Validates the current date against the start and end dates of the cron expression. * If the current date is outside the specified time span, an e
src/CronExpression.ts:491
↓ 1 callers
Function
charTest
(value: string)
src/fields/CronField.ts:233
↓ 1 callers
Method
downloadVersion
(version: string)
benchmarks/version-manager.ts:28
↓ 1 callers
Method
ensureVersionsDir
()
benchmarks/version-manager.ts:13
↓ 1 callers
Method
getLatestVersion
()
benchmarks/version-manager.ts:23
↓ 1 callers
Method
getPackageVersion
(requestedVersion?: string)
benchmarks/version-manager.ts:49
↓ 1 callers
Method
getUTCFullYear
* Returns the UTC year. * @returns {number}
src/CronDate.ts:365
↓ 1 callers
Method
getUTCHours
* Returns the UTC hour. * @returns {number}
src/CronDate.ts:390
↓ 1 callers
Method
getUTCMinutes
* Returns the UTC minutes. * @returns {number}
src/CronDate.ts:398
↓ 1 callers
Method
getUTCMonth
* Returns the UTC month. * @returns {number}
src/CronDate.ts:382
next →
1–100 of 184, ranked by callers