{"id":51035282,"url":"https://github.com/ignisda/english-to-cron","last_synced_at":"2026-06-22T05:02:08.291Z","repository":{"id":363175929,"uuid":"1262213280","full_name":"IgnisDa/english-to-cron","owner":"IgnisDa","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-07T18:14:19.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-07T20:09:56.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IgnisDa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T18:02:10.000Z","updated_at":"2026-06-07T18:14:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/IgnisDa/english-to-cron","commit_stats":null,"previous_names":["ignisda/english-to-cron"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/IgnisDa/english-to-cron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgnisDa%2Fenglish-to-cron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgnisDa%2Fenglish-to-cron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgnisDa%2Fenglish-to-cron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgnisDa%2Fenglish-to-cron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IgnisDa","download_url":"https://codeload.github.com/IgnisDa/english-to-cron/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgnisDa%2Fenglish-to-cron/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34635038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-22T05:02:04.679Z","updated_at":"2026-06-22T05:02:08.276Z","avatar_url":"https://github.com/IgnisDa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# english-to-cron\n\nConvert natural language English descriptions into cron expressions.\n\nA TypeScript port of the [Rust `english-to-cron` crate](https://docs.rs/english-to-cron/latest/english_to_cron/).\n\n## Install\n\n```bash\nnpm install english-to-cron\n```\n\n## Usage\n\n```ts\nimport { strCronSyntax } from \"english-to-cron\";\n\n// Seconds\nstrCronSyntax(\"every 5 seconds\");      // \"0/5 * * * * ? *\"\nstrCronSyntax(\"every second\");         // \"* * * * * ? *\"\n\n// Minutes\nstrCronSyntax(\"every minute\");          // \"0 * * * * ? *\"\nstrCronSyntax(\"every 15 minutes\");      // \"0 0/15 * * * ? *\"\n\n// Hours\nstrCronSyntax(\"every 3 hours\");         // \"0 0 0/3 * * ? *\"\n\n// Days\nstrCronSyntax(\"every day\");             // \"0 0 0 */1 * ? *\"\nstrCronSyntax(\"every day at 4:00 pm\");  // \"0 0 16 */1 * ? *\"\n\n// Specific times\nstrCronSyntax(\"at 10:00 am\");            // \"0 0 10 * * ? *\"\nstrCronSyntax(\"Run at noon\");            // \"0 0 12 * * ? *\"\nstrCronSyntax(\"Run at midnight\");        // \"0 0 0 * * ? *\"\n\n// Day ranges\nstrCronSyntax(\"Monday through Friday\");  // \"0 * * ? * MON-FRI *\"\n\n// With time ranges\nstrCronSyntax(\"every 10 minutes Monday through Friday between 9:00 am and 5:00 pm\");\n// \"0 0/10 9-17 ? * MON-FRI *\"\n\n// Ordinal days\nstrCronSyntax(\"Run at midnight on the 1st and 15th of the month\");\n// \"0 0 0 1,15 * ? *\"\n\n// Multiple times\nstrCronSyntax(\"2pm and 6pm\");            // \"0 0 14,18 * * ? *\"\n\n// Months\nstrCronSyntax(\"every 5 day at 4:30 pm only in September\");\n// \"0 30 16 */5 SEP ? *\"\n\n// Years\nstrCronSyntax(\"every 2 day from January to August in 2020 and 2024\");\n// \"0 0 0 */2 JAN-AUG ? 2020,2024\"\n```\n\n## Error Handling\n\n`strCronSyntax` throws an `EnglishToCronError` on invalid input:\n\n```ts\nimport { strCronSyntax, EnglishToCronError } from \"english-to-cron\";\n\ntry {\n  strCronSyntax(\"invalid input\");\n} catch (e) {\n  if (e instanceof EnglishToCronError) {\n    console.log(e.type);     // \"InvalidInput\"\n    console.log(e.message);  // \"Please enter human readable\"\n  }\n}\n```\n\n## API\n\n### `strCronSyntax(input: string): string`\n\nConverts an English description of a schedule into a 7-field cron expression (seconds, minutes, hours, day-of-month, month, day-of-week, year).\n\nThrows `EnglishToCronError` if the input cannot be parsed.\n\n### `EnglishToCronError`\n\nCustom error class with a `type` property:\n\n| Type              | Description                                        |\n| ----------------- | -------------------------------------------------- |\n| `InvalidInput`    | Input is not a recognizable schedule description  |\n| `Capture`         | A token could not be captured in a given state     |\n| `ParseToNumber`   | A value could not be parsed as a number           |\n| `IncorrectValue`  | An invalid value was encountered                   |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignisda%2Fenglish-to-cron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fignisda%2Fenglish-to-cron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignisda%2Fenglish-to-cron/lists"}