{"id":26361130,"url":"https://github.com/polyseam/cronx","last_synced_at":"2025-07-16T01:04:59.788Z","repository":{"id":281792939,"uuid":"944650055","full_name":"polyseam/cronx","owner":"polyseam","description":"CLI and typescript library for cross-platform cron","archived":false,"fork":false,"pushed_at":"2025-06-02T21:44:40.000Z","size":133073,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-03T11:44:44.318Z","etag":null,"topics":["cron","cross-platform","deno","lightweight","utility"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polyseam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-03-07T18:11:15.000Z","updated_at":"2025-06-02T21:44:23.000Z","dependencies_parsed_at":"2025-03-11T07:28:42.566Z","dependency_job_id":"e85ae958-8188-43d9-8f47-b6aaf9519bf3","html_url":"https://github.com/polyseam/cronx","commit_stats":null,"previous_names":["polyseam/cronx"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/polyseam/cronx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyseam%2Fcronx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyseam%2Fcronx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyseam%2Fcronx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyseam%2Fcronx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polyseam","download_url":"https://codeload.github.com/polyseam/cronx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyseam%2Fcronx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265472562,"owners_count":23771903,"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","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":["cron","cross-platform","deno","lightweight","utility"],"created_at":"2025-03-16T17:20:01.583Z","updated_at":"2025-07-16T01:04:59.776Z","avatar_url":"https://github.com/polyseam.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @polyseam/cronx\n\n**chronix or /ˈkrɒnɪks/**\n\na typescript library and cli for using cron on any platform powered by\n[Deno.cron](https://docs.deno.com/examples/cron/)\n\n### cli installation\n\nShell (Mac, Linux):\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/polyseam/cronx/main/install.sh | sh\n```\n\nPowerShell (Windows):\n\n```powershell\nirm https://raw.githubusercontent.com/polyseam/cronx/main/install.ps1 | iex\n```\n\n## usage\n\n### cli\n\n```bash\ncronx 'echo hello world from the future' -n \"every tuesday at 3pm\"\n# ? Do you want to schedule 'echo hello world from the future' to run 'At 3:00 PM on Tuesday'? (Y/n) › \n# ❯ 0 15 * * 2\n\n# backup file every friday at 8pm\ncronx 'cp /path/to/file.txt \"/path/to/backup/$(date +%G-W%V)\"' -t \"0 20 * * 5\" -l \"file-backup\"\n```\n\n### library\n\nThe [@polyseam/cronx](https://jsr.io/@polyseam/cronx) module provides a simple\ninterface for scheduling cron jobs with command-line executables or async\nfunctions.\n\n```typescript\nimport {\n  CronTabExpression,\n  scheduleCronWithExecutable,\n  scheduleCronWithFunction,\n} from \"@polyseam/cronx\";\n\n// Schedule a job to run at 9 AM Eastern Time (UTC-5)\nscheduleCronWithExecutable('echo \"Good morning East Coast!\"', {\n  cronTabExpression: \"0 9 * * *\", // crontab literal or new CronTabExpression(\"0 9 * * *\")\n  label: \"east-coast-morning\",\n  offset: -5, // Eastern Time (UTC-5)\n});\n\nconst mondayAt9am = CronTabExpression.fromNaturalLanguageSchedule(\n  \"every monday at 9am\",\n);\n\n// Schedule a job to run at 9 AM Pacific Time (UTC-8)\nscheduleCronWithExecutable('echo \"Happy Monday morning West Coast!\"', {\n  cronTabExpression: mondayAt9am,\n  label: \"west-coast-morning\",\n  offset: -8, // Pacific Time (UTC-8)\n});\n\nconst atNoon = CronTabExpression.fromNaturalLanguageSchedule(\n  \"every day at noon\",\n);\n\n// Use local machine timezone (default behavior)\nscheduleCronWithFunction(async () =\u003e {\n  console.log(\"Running in local timezone\");\n}, {\n  cronTabExpression: atNoon, // 12:00 PM every day\n  label: \"local-noon\",\n  // offset parameter omitted - will use local machine's timezone\n});\n\nscheduleCronWithFunction(async () =\u003e {\n  const res = await fetch(\"https://api.example.com\");\n  if (res.ok) {\n    console.log(\"service is live!\");\n  } else {\n    console.log(\"service is down!\");\n  }\n}, {\n  cronxExpression: new CronTabExpression(\"* 0,8,16 * * *\"), // every 8 hours\n  label: \"uptime\",\n  offset: 0, // UTC time is offset=0\n  logLevel: \"DEBUG\", // Optional log level for cronx's internal logging\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyseam%2Fcronx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolyseam%2Fcronx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyseam%2Fcronx/lists"}