cron 0.6.0 copy "cron: ^0.6.0" to clipboard
cron: ^0.6.0 copied to clipboard

A time-based job scheduler similar to cron. Run tasks periodically at fixed times or intervals.

Cron #

Run tasks periodically at fixed times or intervals.

pub package

Usage #

A simple usage example:

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:

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
}
455
likes
140
pub points
97%
popularity

Publisher

verified publisheragilord.com

A time-based job scheduler similar to cron. Run tasks periodically at fixed times or intervals.

Repository (GitHub)
View/report issues

Topics

#cron #scheduler #cron-parser #schedule #cron-time

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

clock

More

Packages that depend on cron