{"id":19837336,"url":"https://github.com/e-e-e/cron-router","last_synced_at":"2026-07-09T12:31:10.703Z","repository":{"id":97158050,"uuid":"56950685","full_name":"e-e-e/cron-router","owner":"e-e-e","description":"An express middleware to route requests based on server time.","archived":false,"fork":false,"pushed_at":"2016-04-24T02:41:03.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T23:47:12.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/e-e-e.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}},"created_at":"2016-04-24T02:39:44.000Z","updated_at":"2016-04-24T02:39:50.000Z","dependencies_parsed_at":"2023-05-23T18:45:19.291Z","dependency_job_id":null,"html_url":"https://github.com/e-e-e/cron-router","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/e-e-e/cron-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-e-e%2Fcron-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-e-e%2Fcron-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-e-e%2Fcron-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-e-e%2Fcron-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e-e-e","download_url":"https://codeload.github.com/e-e-e/cron-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-e-e%2Fcron-router/sbom","scorecard":{"id":362910,"data":{"date":"2025-08-11","repo":{"name":"github.com/e-e-e/cron-router","commit":"f1ebace337b2ae3d9d9c5a289de2067bb2fc26ac"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/2 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T11:13:08.215Z","repository_id":97158050,"created_at":"2025-08-18T11:13:08.215Z","updated_at":"2025-08-18T11:13:08.215Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35299762,"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-07-09T02:00:07.329Z","response_time":57,"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":"2024-11-12T12:14:07.393Z","updated_at":"2026-07-09T12:31:10.698Z","avatar_url":"https://github.com/e-e-e.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cron-router\n\n## About\n\n**Cron-router** is a simple middleware for express which enables routing based on server time. This was initially written to enable a small parasitic art festival to occur on the www.safari.org.au website during the 2016 SafARI festival. The alternative programming hijacked the official website between 9pm to 9am AEST and was different based on the day of the week.\n\n## Usage:\n\ncron-router exposes one function **cronRoute** which takes one argument, and array of Match objects.\n\nMatch object should look like this:\n\n```js\nvar match = {\n\tmatch: {\n\t\tyear: /* optional, number or {from: number, to: number } */\n\t\tmonth: /* optional, number or {from: number, to: number } */\n\t\tdate: /* optional, number or {from: number, to: number } */\n\t\tday: /* optional number or {from: number, to: number } */\n\t\thours: /* optional number or {from: number, to: number } */\n\t\tminutes: /* optional number or {from: number, to: number } */\n\t},\n\troute: /* an express Router */\n}\n```\n\nMatch properties (year, month, date, etc) accept either an explicit number or a range object {from: x, to: y}. CronRouter compares all the provided match values to the current server date and if equal or within the inclusive range, the request is passed to the provided express router.  \n\n### example:\n\n```js\nvar express\t= require('express');\nvar cronrouter = require('cron-router');\n\nvar app = express();\n\nvar route_A = express.Router();\nroute_A.get('/',(req,res)=\u003e{\n\tres.send('route A is active between 9pm to midnight on Sundays.');\n});)\nvar route_B = express.Router();\nroute_B.get('/',(req,res)=\u003e{\n\tres.send('route B is active between midnight to 9am on Mondays.');\n});)\n\nvar matches = [\n\t{\n\t\tmatch: {\n\t\t\tday: 0,\n\t\t\thours: {from: 9, to: 24}\n\t\t},\n\t\troute: route_A\n\t},{\n\t\tmatch: {\n\t\t\tday: 1, //sub\n\t\t\thours: {from: 0, to: 8}\n\t\t},\n\t\troute: route_B\n\t},\n];\n\napp.use(cronrouter.cronRoute(matches));\n\n//if no matches it \napp.get('/', (req,res)=\u003e {\n\tres.send('This is the default if none of the cron-routes are matched.');\n});\n\napp.listen(8080, (err, suc)=\u003e {\n\tif (err) {\n\t\tthrow err;\n\t} else {\n\t\tconsole.log('listening');\n\t}\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-e-e%2Fcron-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe-e-e%2Fcron-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-e-e%2Fcron-router/lists"}