{"id":23974045,"url":"https://github.com/mahyarmirrashed/cron-compose","last_synced_at":"2025-11-16T18:03:02.333Z","repository":{"id":205523856,"uuid":"714457576","full_name":"mahyarmirrashed/cron-compose","owner":"mahyarmirrashed","description":"Easily craft precise cron expressions using a declarative syntax.","archived":false,"fork":false,"pushed_at":"2023-11-10T00:29:46.000Z","size":250,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T16:18:02.389Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mahyarmirrashed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-04T22:39:49.000Z","updated_at":"2023-11-09T23:55:51.000Z","dependencies_parsed_at":"2025-02-24T16:17:45.769Z","dependency_job_id":"780e931b-be39-447e-8966-882bb51fbf01","html_url":"https://github.com/mahyarmirrashed/cron-compose","commit_stats":null,"previous_names":["mahyarmirrashed/cron-compose"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/mahyarmirrashed/cron-compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahyarmirrashed%2Fcron-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahyarmirrashed%2Fcron-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahyarmirrashed%2Fcron-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahyarmirrashed%2Fcron-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mahyarmirrashed","download_url":"https://codeload.github.com/mahyarmirrashed/cron-compose/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahyarmirrashed%2Fcron-compose/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284750955,"owners_count":27057456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"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":"2025-01-07T05:21:03.844Z","updated_at":"2025-11-16T18:03:02.302Z","avatar_url":"https://github.com/mahyarmirrashed.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cron Compose\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/mahyarmirrashed/cron-compose/blob/master/LICENSE.md)\n[![NodeJS](https://img.shields.io/badge/node-%3E%3D16-green)](https://nodejs.org/en/download/)\n[![Codecov](https://img.shields.io/codecov/c/github/mahyarmirrashed/cron-compose)](https://codecov.io/gh/mahyarmirrashed/cron-compose)\n\nCron Compose is a TypeScript library designed to make the creation of cron expressions simpler and less error-prone. With an intuitive API, it abstracts the complexities of cron syntax, allowing developers to build cron expressions through method chaining and clear function calls.\n\n## Features\n\n- **Ease of Use**: Construct cron expressions through easy-to-understand method calls.\n- **Manipulate Existing Strings**: Load existing cron expressions and manipulate them.\n- **Flexibility**: Add or remove specific time units or ranges effortlessly.\n- **Type Safety**: Leveage TypeScript's type-checking to avoid invalid inputs.\n- **Clean Output**: Automatically removes unnecessary elements and outputs clean cron strings.\n\n## Installation\n\nTo install Cron Compose, run the following command:\n\n```bash\nnpm install cron-compose\n```\n\n## Usage\n\nHere's how to use Cron Compose:\n\n```ts\nimport { CronComposer, SlotType } from \"cron-compose\";\n\nconst cronComposer = new CronComposer()\n  .addSingle(SlotType.Minute, 1)\n  .addRange(SlotType.Day, 1, 8)\n  .addRange(SlotType.Day, 6, 13);\n\nconsole.log(cronComposer.toString()); // \"1 * 1-13 * *\"\n```\n\nYou can also parse existing Cron strings with it:\n\n```ts\nimport { CronComposer } from \"cron-compose\";\n\nconst cronComposer = new CronComposer().parse(\n  \"3-4,5,6-8 */30,*/20 5-8,10-12 1,1 5,3,5 *\",\n);\n\nconsole.log(cronComposer.toString()); // \"3-8 0,20,30,40 5-8,10-12 1 3,5 *\"\n```\n\nFinally, you can use the more human-readable API to create your Cron strings:\n\n```ts\nimport { CronComposer } from \"cron-compose\";\n\nconsole.log(\n  new CronComposer()\n    .parse(\"* * * * *\")\n    .every(1, \"hours\")\n    .except.at(1, \"pm\")\n    .toString(),\n); // \"* 0-12,14-23 * * *\"\n```\n\n## Testing\n\nTo run tests, use the following command:\n\n```bash\npnpm run test\n```\n\n## Contributing\n\nI welcome all contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to contribute.\n\n## License\n\nThis project is licensed under the the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahyarmirrashed%2Fcron-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahyarmirrashed%2Fcron-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahyarmirrashed%2Fcron-compose/lists"}