Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agilord/cron
A cron-like time-based job scheduler for Dart
https://github.com/agilord/cron
Last synced: 7 days ago
JSON representation
A cron-like time-based job scheduler for Dart
- Host: GitHub
- URL: https://github.com/agilord/cron
- Owner: agilord
- License: bsd-3-clause
- Created: 2017-03-30T21:37:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-06-24T21:36:41.000Z (7 months ago)
- Last Synced: 2025-01-13T13:21:24.698Z (15 days ago)
- Language: Dart
- Size: 33.2 KB
- Stars: 119
- Watchers: 5
- Forks: 22
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Cron
Run tasks periodically at fixed times or intervals.
[![pub package](https://img.shields.io/pub/v/cron.svg)](https://pub.dev/packages/cron)
## Usage
A simple usage example:
```dart
import 'package:cron/cron.dart';void main() {
final cron = Cron();cron.schedule(Schedule.parse('*/3 * * * *'), () async {
print('every three minutes');
});cron.schedule(Schedule.parse('8-11 * * * *'), () async {
print('between every 8 and 11 minutes');
});
}
```## Cron parser
You can easily create and parse [cron format](https://en.wikipedia.org/wiki/Cron):```dart
import 'package:cron/cron.dart';void main() {
print(Schedule.parse('3-5 * * * *').minutes); // [3, 4, 5]
print(Schedule(hours: 12, minutes: 25, weekdays: [2, 3])
.toCronString()); // 25 12 * * 2,3
}
```## Links
- [source code][source]
- contributors: [Agilord][agilord][source]: https://github.com/agilord/cron
[agilord]: https://www.agilord.com/