{"id":17592306,"url":"https://github.com/justpowerful/hono-autoload","last_synced_at":"2025-04-29T11:57:26.746Z","repository":{"id":258777222,"uuid":"875675185","full_name":"JustPowerful/hono-autoload","owner":"JustPowerful","description":"A package to autoload your hono routes and middleware easier 🔥✨","archived":false,"fork":false,"pushed_at":"2024-10-23T08:04:47.000Z","size":157,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-29T11:57:21.456Z","etag":null,"topics":["auto-load","autoloader","bun","hono","honojs","nodejs","typescript"],"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/JustPowerful.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}},"created_at":"2024-10-20T15:49:43.000Z","updated_at":"2024-11-22T09:29:57.000Z","dependencies_parsed_at":"2025-03-08T13:33:39.483Z","dependency_job_id":"9deea40a-2576-4390-b86d-8f3ec272a67b","html_url":"https://github.com/JustPowerful/hono-autoload","commit_stats":null,"previous_names":["justpowerful/hono-autoload"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustPowerful%2Fhono-autoload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustPowerful%2Fhono-autoload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustPowerful%2Fhono-autoload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustPowerful%2Fhono-autoload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JustPowerful","download_url":"https://codeload.github.com/JustPowerful/hono-autoload/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251498964,"owners_count":21598979,"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":["auto-load","autoloader","bun","hono","honojs","nodejs","typescript"],"created_at":"2024-10-22T05:09:45.953Z","updated_at":"2025-04-29T11:57:26.740Z","avatar_url":"https://github.com/JustPowerful.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hono-autoload\n\nAn auto-loader for hono to simplify the routing process, and to void boilerplate code.\n\n## Installation\n\nfor npm:\n\n```bash\nnpm i hono-autoload\n```\n\nfor bun:\n\n```bash\nbun i hono-autoload\n```\n\n## Usage\n\n```ts\n// index.ts\nimport { Hono } from 'hono';\nimport { createAutoloader, createAutoloaderMiddleware } from 'hono-autoload';\nimport { join } from 'path';\n\nconst app = new Hono();\n\nasync function runLoader() {\n  // NOTE: put your middleware loader before the route loader\n  await createAutoloaderMiddleware(app, join(__dirname, 'middleware'));\n  await createAutoloader(app, join(__dirname, 'routes'));\n}\n\nrunLoader().then(() =\u003e {\n  console.log('Loaded all routes and middleware');\n});\n\n// ... listen for your server here\n```\n\n## Creating a route module\n\ncreate a `routes` directory inside your project and put your route modules in there.\nA route module should export a `path` and `handler` property like this:\n\n```ts\nimport type { AutoLoadRoute } from \"hono-autoload/types\";\nconst routeModule: AutoLoadRoute = {\n  path: \"/api\",\n  handler: app,\n};\nexport default routeModule; // don't forget to export default the route module\n```\n\n## Creating a middleware module\n\ncreate a `middleware` directory inside your project and put your middleware modules in there.\nA middleware module should export a `handler` and `matcher` property like this:\n\n```ts\nimport type { AutoLoadMiddleware } from \"hono-autoload/types\";\nconst middlewareModule: AutoLoadMiddleware = {\n  handler: app,\n  matcher: \"/api\", // NOTE: not defining a matcher means the middleware works on all routes\n};\nexport default middlewareModule; // don't forget to export default the middleware module\n```\n\n## License\n\nMIT\n\n## Contributing\n\nYou can contribute to this project on [GitHub](https://github.com/honojs/hono-autoload).\nContact me if you have any questions or suggestions.\nE-mail: ahmedaminedoudech@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustpowerful%2Fhono-autoload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustpowerful%2Fhono-autoload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustpowerful%2Fhono-autoload/lists"}