Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/samwho/everycron

Every cron expression in a single enum.
https://github.com/samwho/everycron

Last synced: about 1 month ago
JSON representation

Every cron expression in a single enum.

Awesome Lists containing this project

README

        

# everycron

Find crons hard to read? Always opening https://crontab.guru to figure out
what's going on? All your problems are about to be solved.

`everycron` exposes constants with human-readable names to make it much easier
to find the cron expression you need!

## Generating `src/crons.ts`

`generate.ts` is what generates `src/crons.ts`. I did used to commit it to
the repo but it's massive and costs about $5/mo in git LFS, and the bit isn't
worth that to me.

```bash
bun generate.ts
```

This takes about 5-10 minutes and needs about 7GB of RAM.

## Stats

`src/crons.ts` contains:

1. 23,804,927 unique cron expressions.
2. 1.9GB of data.

It is highly unlikely your cron use-case can not be served by this file.

## Usage

```typescript
import cron from "./src/crons";

console.log(cron.EVERY_MINUTE);
```

On my M1 Max MacBook Pro this takes 3 hours and 38 seconds to run, and consumes
about 14GB of RAM.

## Sample contents

In case you don't want to clone this repo and spend the 5-10 minutes generating
the file for yourself, here's the first 100 lines of `src/crons.ts`:

```typescript
export default {
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_SUNDAY_ONLY_IN_JANUARY:"0 0 1 1 0",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_MONDAY_ONLY_IN_JANUARY:"0 0 1 1 1",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_TUESDAY_ONLY_IN_JANUARY:"0 0 1 1 2",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_WEDNESDAY_ONLY_IN_JANUARY:"0 0 1 1 3",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_THURSDAY_ONLY_IN_JANUARY:"0 0 1 1 4",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_FRIDAY_ONLY_IN_JANUARY:"0 0 1 1 5",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_SATURDAY_ONLY_IN_JANUARY:"0 0 1 1 6",
AT_00_00_ON_DAY_1_OF_MONTH_ONLY_IN_JANUARY:"0 0 1 1 *",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_2_DAYS_OF_WEEK_ONLY_IN_JANUARY:"0 0 1 1 */2",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_3_DAYS_OF_WEEK_ONLY_IN_JANUARY:"0 0 1 1 */3",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_4_DAYS_OF_WEEK_ONLY_IN_JANUARY:"0 0 1 1 */4",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_5_DAYS_OF_WEEK_ONLY_IN_JANUARY:"0 0 1 1 */5",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_6_DAYS_OF_WEEK_ONLY_IN_JANUARY:"0 0 1 1 */6",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_7_DAYS_OF_WEEK_ONLY_IN_JANUARY:"0 0 1 1 */7",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_SUNDAY_ONLY_IN_FEBRUARY:"0 0 1 2 0",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_MONDAY_ONLY_IN_FEBRUARY:"0 0 1 2 1",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_TUESDAY_ONLY_IN_FEBRUARY:"0 0 1 2 2",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_WEDNESDAY_ONLY_IN_FEBRUARY:"0 0 1 2 3",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_THURSDAY_ONLY_IN_FEBRUARY:"0 0 1 2 4",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_FRIDAY_ONLY_IN_FEBRUARY:"0 0 1 2 5",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_SATURDAY_ONLY_IN_FEBRUARY:"0 0 1 2 6",
AT_00_00_ON_DAY_1_OF_MONTH_ONLY_IN_FEBRUARY:"0 0 1 2 *",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_2_DAYS_OF_WEEK_ONLY_IN_FEBRUARY:"0 0 1 2 */2",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_3_DAYS_OF_WEEK_ONLY_IN_FEBRUARY:"0 0 1 2 */3",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_4_DAYS_OF_WEEK_ONLY_IN_FEBRUARY:"0 0 1 2 */4",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_5_DAYS_OF_WEEK_ONLY_IN_FEBRUARY:"0 0 1 2 */5",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_6_DAYS_OF_WEEK_ONLY_IN_FEBRUARY:"0 0 1 2 */6",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_7_DAYS_OF_WEEK_ONLY_IN_FEBRUARY:"0 0 1 2 */7",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_SUNDAY_ONLY_IN_MARCH:"0 0 1 3 0",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_MONDAY_ONLY_IN_MARCH:"0 0 1 3 1",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_TUESDAY_ONLY_IN_MARCH:"0 0 1 3 2",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_WEDNESDAY_ONLY_IN_MARCH:"0 0 1 3 3",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_THURSDAY_ONLY_IN_MARCH:"0 0 1 3 4",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_FRIDAY_ONLY_IN_MARCH:"0 0 1 3 5",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_SATURDAY_ONLY_IN_MARCH:"0 0 1 3 6",
AT_00_00_ON_DAY_1_OF_MONTH_ONLY_IN_MARCH:"0 0 1 3 *",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_2_DAYS_OF_WEEK_ONLY_IN_MARCH:"0 0 1 3 */2",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_3_DAYS_OF_WEEK_ONLY_IN_MARCH:"0 0 1 3 */3",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_4_DAYS_OF_WEEK_ONLY_IN_MARCH:"0 0 1 3 */4",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_5_DAYS_OF_WEEK_ONLY_IN_MARCH:"0 0 1 3 */5",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_6_DAYS_OF_WEEK_ONLY_IN_MARCH:"0 0 1 3 */6",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_7_DAYS_OF_WEEK_ONLY_IN_MARCH:"0 0 1 3 */7",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_SUNDAY_ONLY_IN_APRIL:"0 0 1 4 0",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_MONDAY_ONLY_IN_APRIL:"0 0 1 4 1",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_TUESDAY_ONLY_IN_APRIL:"0 0 1 4 2",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_WEDNESDAY_ONLY_IN_APRIL:"0 0 1 4 3",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_THURSDAY_ONLY_IN_APRIL:"0 0 1 4 4",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_FRIDAY_ONLY_IN_APRIL:"0 0 1 4 5",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_SATURDAY_ONLY_IN_APRIL:"0 0 1 4 6",
AT_00_00_ON_DAY_1_OF_MONTH_ONLY_IN_APRIL:"0 0 1 4 *",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_2_DAYS_OF_WEEK_ONLY_IN_APRIL:"0 0 1 4 */2",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_3_DAYS_OF_WEEK_ONLY_IN_APRIL:"0 0 1 4 */3",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_4_DAYS_OF_WEEK_ONLY_IN_APRIL:"0 0 1 4 */4",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_5_DAYS_OF_WEEK_ONLY_IN_APRIL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Y_IN_JULY:"0 0 1 7 1",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_TUESDAY_ONLY_IN_JULY:"0 0 1 7 2",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_WEDNESDAY_ONLY_IN_JULY:"0 0 1 7 3",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_THURSDAY_ONLY_IN_JULY:"0 0 1 7 4",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_FRIDAY_ONLY_IN_JULY:"0 0 1 7 5",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_SATURDAY_ONLY_IN_JULY:"0 0 1 7 6",
AT_00_00_ON_DAY_1_OF_MONTH_ONLY_IN_JULY:"0 0 1 7 *",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_2_DAYS_OF_WEEK_ONLY_IN_JULY:"0 0 1 7 */2",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_3_DAYS_OF_WEEK_ONLY_IN_JULY:"0 0 1 7 */3",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_4_DAYS_OF_WEEK_ONLY_IN_JULY:"0 0 1 7 */4",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_5_DAYS_OF_WEEK_ONLY_IN_JULY:"0 0 1 7 */5",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_6_DAYS_OF_WEEK_ONLY_IN_JULY:"0 0 1 7 */6",
AT_00_00_ON_DAY_1_OF_MONTH_EVERY_7_DAYS_OF_WEEK_ONLY_IN_JULY:"0 0 1 7 */7",
AT_00_00_ON_DAY_1_OF_MONTH_AND_ON_SUNDAY_ONLY_IN_AUGUST:"0 0 1 8 0",
```