{"id":20472100,"url":"https://github.com/hywax/nuxt-cron","last_synced_at":"2025-04-13T11:10:26.801Z","repository":{"id":206546291,"uuid":"716479826","full_name":"hywax/nuxt-cron","owner":"hywax","description":"A Nuxt module for cron jobs in your app.","archived":false,"fork":false,"pushed_at":"2025-04-11T19:06:23.000Z","size":3151,"stargazers_count":81,"open_issues_count":12,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T20:24:16.273Z","etag":null,"topics":["cron","node","nuxt-module","nuxt3","nuxt4","typescript"],"latest_commit_sha":null,"homepage":"https://nuxt-cron.hywax.space","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/hywax.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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}},"created_at":"2023-11-09T08:19:57.000Z","updated_at":"2025-04-01T12:06:47.000Z","dependencies_parsed_at":"2024-01-01T09:51:18.938Z","dependency_job_id":"37176b0d-cdce-4c13-b06b-3fe72dfe2cae","html_url":"https://github.com/hywax/nuxt-cron","commit_stats":null,"previous_names":["hywax/nuxt-cron"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hywax%2Fnuxt-cron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hywax%2Fnuxt-cron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hywax%2Fnuxt-cron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hywax%2Fnuxt-cron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hywax","download_url":"https://codeload.github.com/hywax/nuxt-cron/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248474294,"owners_count":21109866,"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","node","nuxt-module","nuxt3","nuxt4","typescript"],"created_at":"2024-11-15T14:18:34.185Z","updated_at":"2025-04-13T11:10:26.789Z","avatar_url":"https://github.com/hywax.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"[![nuxt-cron](https://raw.githubusercontent.com/hywax/nuxt-cron/main/docs/public/cover.jpg)](https://nuxt-cron.hywax.space)\n\n# Nuxt Cron\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![License][license-src]][license-href]\n\nA Nuxt module for cron jobs in your app.\n\n- [📖 Documentation](https://nuxt-cron.hywax.space)\n- [🏀 Playground](https://nuxt-cron.hywax.space/playground)\n- [✨ Releases](https://github.com/hywax/nuxt-cron/releases)\n\n## Features\n\n- 👌\u0026nbsp; 19 time presets\n- 🕔️\u0026nbsp; Time zone support\n- 🪄️\u0026nbsp; TypeScript support\n- ✨\u0026nbsp; Auto imports enabled\n- ⚡\u0026nbsp; Zero configuration to start\n- 🤝\u0026nbsp; Nuxt 3/4 support\n- 📦\u0026nbsp; Extendable by [Nuxt modules](https://nuxt.com/modules)\n\n## Installation\n\n```bash\n# Using pnpm\npnpm add nuxt-cron -D\n\n# Using yarn\nyarn add nuxt-cron -D\n\n# Using npm\nnpm install nuxt-cron -D\n```\n\n## Usage\n\n### Setup\n\nAdd `nuxt-cron` to the `modules` section of `nuxt.config.ts`\n\n```js\nexport default defineNuxtConfig({\n  modules: ['nuxt-cron']\n})\n```\n\n### Configuration\n\nYou can configure the module by adding a `nuxt-cron` section to your nuxt.config file.\n\n```js\nexport default defineNuxtConfig({\n  cron: {\n    runOnInit: true,\n    timeZone: 'Africa/Abidjan',\n    jobsDir: 'cron'\n  }\n})\n```\n\nby default, `nuxt-cron` will auto-import your cron from the models directory from server directory. You can change this behavior by setting the `jobsDir` option.\n\n## API\n\n### defineCronHandler\n\nThis function creates a new cron job. Example usage:\n\n```ts\n// server/cron/job.ts\nimport { defineCronHandler } from '#nuxt/cron'\n\nexport default defineCronHandler('everySecond', () =\u003e {\n  console.log('I run every seconds')\n})\n```\n\nor use with params:\n\n```ts\n// server/cron/job.ts\nimport { defineCronHandler } from '#nuxt/cron'\n\nexport default defineCronHandler('everySecond', () =\u003e {\n  console.log('I run every seconds')\n}, { runOnInit: true })\n```\n\nMore examples can be found [here](https://nuxt-cron.hywax.space/examples/base.html).\n\n## Credits\n\nA huge thank you to everyone who is helping to improve `nuxt-cron`. Thanks to you, the project can evolve!\n\n### Contributors\n\nTo become a contributor, please follow our [contributing guide](https://nuxt-cron.hywax.space/community/contributing.html).\n\n\u003cimg src=\"https://contrib.rocks/image?repo=hywax/nuxt-cron\" alt=\"nuxt-cron\" /\u003e\n\n## License\n\nThis app is open-sourced software licensed under the [MIT license](https://github.com/hywax/nuxt-cron/blob/main/LICENSE).\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/nuxt-cron/latest.svg?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\n[npm-version-href]: https://npmjs.com/package/nuxt-cron\n[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-cron.svg?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\n[npm-downloads-href]: https://npmjs.com/package/nuxt-cron\n[license-src]: https://img.shields.io/npm/l/nuxt-cron.svg?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\n[license-href]: https://npmjs.com/package/nuxt-cron\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhywax%2Fnuxt-cron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhywax%2Fnuxt-cron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhywax%2Fnuxt-cron/lists"}