{"id":18098692,"url":"https://github.com/shakee93/node-reel","last_synced_at":"2025-04-13T13:07:52.747Z","repository":{"id":57154771,"uuid":"143456108","full_name":"shakee93/node-reel","owner":"shakee93","description":"Human friendly cron for Node JS :cupid:","archived":false,"fork":false,"pushed_at":"2020-06-22T12:54:46.000Z","size":17,"stargazers_count":47,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-13T13:07:46.524Z","etag":null,"topics":["cron","laravel","node","node-cron","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/shakee93.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}},"created_at":"2018-08-03T17:37:29.000Z","updated_at":"2023-12-17T18:10:43.000Z","dependencies_parsed_at":"2022-09-07T00:41:12.194Z","dependency_job_id":null,"html_url":"https://github.com/shakee93/node-reel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakee93%2Fnode-reel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakee93%2Fnode-reel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakee93%2Fnode-reel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakee93%2Fnode-reel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shakee93","download_url":"https://codeload.github.com/shakee93/node-reel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717242,"owners_count":21150389,"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","laravel","node","node-cron","nodejs"],"created_at":"2024-10-31T20:12:24.493Z","updated_at":"2025-04-13T13:07:52.709Z","avatar_url":"https://github.com/shakee93.png","language":"JavaScript","funding_links":[],"categories":["Cron"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg width=\"260\" src=\"https://shakee93.github.io/vue-toasted/assets/images/node-reel.svg\" alt=\"node-reel logo\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"http://npmjs.com/package/node-reel\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/62a0977219e4ff041365ce6c762e17f27a66b9d7/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f6e6f64652d7265656c2e7376673f7374796c653d666c61742d737175617265\" alt=\"npm\" data-canonical-src=\"https://img.shields.io/npm/v/node-reel.svg?style=flat-square\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/14835725/43674196-6f593114-97ed-11e8-80c1-d054391062d6.png\" alt=\"node-reel logo\"\u003e\n\u003c/p\u003e\n\n**`node-reel`** is a heavily inspired by laravel task scheduler syntax thanks to [@taylorotwell](https://github.com/taylorotwell) and uses [`node-cron`](https://github.com/merencia/node-cron) by [merencia](https://github.com/merencia) as the default cron driver to run cron tasks.\n\n### why node-reel ? :wink:\n```javascript\nconst reel = require('node-reel')\n\nreel().call(() =\u003e {\n\t// say hello on mondays\n}).weekly().mondays().at('13:00').run()\n\nreel().command('npm run clean_trash').everyThirtyMinutes().run()\n\n```\n\n### Install\nusing the npm or yarn\n```shell\nnpm i node-reel --save\n```\n\n### Schedule Frequencies\nMethod  | Description\n------------- | -------------\n`.cron('* * * * *');`  |  Run the task on a custom Cron schedule\n`.everyMinute();`  |  Run the task every minute\n`.everyFiveMinutes();`  |  Run the task every five minutes\n`.everyTenMinutes();`  |  Run the task every ten minutes\n`.everyFifteenMinutes();`  |  Run the task every fifteen minutes\n`.everyThirtyMinutes();`  |  Run the task every thirty minutes\n`.everyFortyFiveMinutes();`  |  Run the task every forty five minutes\n`.hourly();`  |  Run the task every hour\n`.hourlyAt(17);`  |  Run the task every hour at 17 mins past the hour\n`.daily();`  |  Run the task every day at midnight\n`.dailyAt('13:00');`  |  Run the task every day at 13:00\n`.twiceDaily(1, 13);`  |  Run the task daily at 1:00 \u0026 13:00\n`.weekly();`  |  Run the task every week\n`.weeklyOn(1, '8:00');`  |  Run the task every week on Tuesday at 8:00\n`.monthly();`  |  Run the task every month\n`.monthlyOn(4, '15:00');`  |  Run the task every month on the 4th at 15:00\n`.quarterly();` |  Run the task every quarter\n`.yearly();`  |  Run the task every year\n`.weekdays();`  |  Limit the task to weekdays\n`.sundays();`  |  Limit the task to Sunday\n`.mondays();`  |  Limit the task to Monday\n`.tuesdays();`  |  Limit the task to Tuesday\n`.wednesdays();`  |  Limit the task to Wednesday\n`.thursdays();`  |  Limit the task to Thursday\n`.fridays();`  |  Limit the task to Friday\n`.saturdays();`  |  Limit the task to Saturday\n\nlink to laravel task scheduler doc : [task scheduler](https://laravel.com/docs/5.6/scheduling)\n\n### Methods\nMethod  | Description\n------------- | -------------\n`.call(function)`  |  pass a callback which will triggered\n`.command(string/array);`  |  pass cli commands as string or array of strings\n`.run();`  |  call this at the end of the chain to initiate.\n\n\n### Adapters\n`node-reel` will use `node-cron` as default adapter. but you can pass your own adapter and return your own object.\n\n```javascript\nconst Reel = require('node-reel').Reel;\n\nconst reel = new Reel({\n    adapter : (object) =\u003e {\n    \t// use your cron library or custom cron logic\n    \t// below are the available properties\n    \tlet expression = object.expression;\n    \tlet callback = object.callback;\n    \tlet timezone = object.timezone;\n    \t\n    \treturn mycron.schedule(expression, callback);\n    }\n})\n\n\n// use it as follows\nreel.command('npm run foo').hourly().run();\n```\n\n### Monitor the Scheduled Executions\nIf you want to keep an eye on every execution and make sure they succeed or fail, or even if they execute at all, or make a report of each, you can:\n\n```javascript\nreel().command('npm run clean_trash', (error) =\u003e {\n    if (error) {\n\t// Handle the error\n    } else {\n\t// Report the success\n    }\n}).everyThirtyMinutes().run()\n```\n\n### Notes\nissues, pull request and feedback are welcome !\nHappy Scheduling !!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakee93%2Fnode-reel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshakee93%2Fnode-reel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakee93%2Fnode-reel/lists"}