Skip to content

Releases: harrisiirak/cron-parser

v5.0.4

22 Feb 11:31
839d9e2
Compare
Choose a tag to compare
  • 84e100f - Set milliseconds to 0 before returning schedule (#368)

v5.0.3

19 Feb 18:03
c4a3213
Compare
Choose a tag to compare
  • e0bda7e - Parse field for day of week should allow 0 or SUN values (#366)

v5.0.2

18 Feb 15:31
88ee899
Compare
Choose a tag to compare
  • fe6b90e - Add fs/promises to browser import ignore list (#365)

v5.0.1

16 Feb 18:32
557dbf9
Compare
Choose a tag to compare

This first patch release contains couple of quick bugfixes that were reported after the first release of v5. Thanks for everybody that tried the new version out and provided some feedback.

  • 9b1e0f3 - Removed unused jest-runner-tsd dev dependency (#361)
  • 683f585 - Use dynamic loading for fs and fs/promises to restore ability to use this package in the browser environment (#362)
  • 5e10db0 - Remove assert module usage (can't be used in the browser environment without polyfill or included extra package) and improve/add test cases (#364)
  • 7ca5c94 - Remove unused .npmignore
  • 9ddf705 - Fix benchmarking tool for module interface

v5.0.0 - TypeScript rewrite

13 Feb 08:00
a1a9dbe
Compare
Choose a tag to compare

All changes come from #360

Changelog

  • BREAKING CHANGE: Bumped the minimum Node.js version to >= 18 and TypeScript to >= 5.
  • BREAKING CHANGE: interval.fields (CronExpression.interval) now returns a readonly instance of CronFieldsCollection instead of a regular array. See CronFieldsCollection.from for how to modify the underlying data structure.
  • BREAKING CHANGE: Moved crontab file parsing from CronParser to a standalone CronFileParser class (fixes #112).
  • BREAKING CHANGE: Removal of utc flag from the options. Pass in UTC timezone instead.
  • Refactored the codebase to TypeScript (fixes #190).
  • Cleaned up test suites, removed duplicate test cases, and switched from tap to jest.
  • Improved documentation and introduced documentation generated by typedoc (fixes #309, #322, #269).
  • Added benchmark tooling to help detect future performance regressions.
  • Added CronExpression.includesDate to evaluate whether a given date matches the pattern (closes #299).
  • Fixed issues where certain range and repeat field expressions produced invalid intervals (fixes #156).
  • Fixed an issue with day-of-month handling when the range is explicitly set and no wildcard is used (fixes #284).
  • Improved repeat serialization for stringification (fixes #236).

Performance improvements

While this release won't address the performance issues reported in #287, it will bring some performance improvements of around 20-30% on average, depending on the pattern complexity. The following benchmark results were produced on my 2023 MBP.

┌────────────────────┬────────────┬────────────┬──────────┬─────┐
│ Pattern            │   Old Mean │   New Mean │   Change │     │
├────────────────────┼────────────┼────────────┼──────────┼─────┤
│ * * * * * *        │    73.55ms │    37.43ms │   49.10% │  ↑  │
├────────────────────┼────────────┼────────────┼──────────┼─────┤
│ 0 * * 1,4-10,L * * │  3504.51ms │  2338.42ms │   33.27% │  ↑  │
├────────────────────┼────────────┼────────────┼──────────┼─────┤
│ 10-30/2 2 12 8 0   │  3111.18ms │  2234.32ms │   28.18% │  ↑  │
├────────────────────┼────────────┼────────────┼──────────┼─────┤
│ 0 0 0 * * 4,6L     │  9400.33ms │  6825.61ms │   27.39% │  ↑  │
├────────────────────┼────────────┼────────────┼──────────┼─────┤
│ 0 12 */5 6 *       │  7442.68ms │  5645.95ms │   24.14% │  ↑  │
├────────────────────┼────────────┼────────────┼──────────┼─────┤
│ 0 15 */5 5 *       │  6998.87ms │  5443.22ms │   22.23% │  ↑  │
├────────────────────┼────────────┼────────────┼──────────┼─────┤
│ 0 0 6-20/2,L 2 *   │  8832.87ms │  6947.63ms │   21.34% │  ↑  │
├────────────────────┼────────────┼────────────┼──────────┼─────┤
│ 0 0 0 * * 1L,5L    │ 15416.07ms │ 12474.12ms │   19.08% │  ↑  │
├────────────────────┼────────────┼────────────┼──────────┼─────┤
│ 10 2 12 8 7        │  7105.79ms │  5947.91ms │   16.29% │  ↑  │
└────────────────────┴────────────┴────────────┴──────────┴─────┘

Benchmarks can be run locally by executing the command.:

npm run bench

Individual patterns can be benchmarked by executing bench:pattern command:

npm run bench:pattern "* * * * * *"

4.9.0

14 Aug 14:10
fa94e7f
Compare
Choose a tag to compare

4.8.1

07 Mar 17:05
b440182
Compare
Choose a tag to compare
  • Fix multiple value ranges serialisation (#316)

4.8.0

06 Mar 09:02
a548a51
Compare
Choose a tag to compare
  • Fix expression stringify range step handling (#312)
  • Fix invalid expression example in the documentation (#314)
  • Update deps

4.7.1

09 Jan 18:21
952c7ed
Compare
Choose a tag to compare
  • Update deps (#305)

4.7.0

16 Nov 15:46
4273208
Compare
Choose a tag to compare
  • Fix to allow the same value for range start and end value (#291)
  • Fix Sunday DOW handling in the range value (#292)
  • Stricter repeat value validation (#294)
  • Remove duplicate day of week values upon stringify (#295)
  • Update Travis test matrix and include nodejs v18/v19 (e17df0b)
  • Update package-lock.json from v1 to v2 (#298)
  • Update outdated dependencies (#296)
  • Update min required TypeScript version information (fefd0a2)