{"id":31287912,"url":"https://github.com/comamoca/hinoto","last_synced_at":"2026-03-10T05:02:15.715Z","repository":{"id":316379215,"uuid":"1063122389","full_name":"Comamoca/hinoto","owner":"Comamoca","description":"A web framework written in Gleam, designed for multiple JavaScript runtimes and BEAM!","archived":false,"fork":false,"pushed_at":"2026-01-03T19:55:33.000Z","size":225,"stargazers_count":58,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-17T22:22:15.788Z","etag":null,"topics":["bun","cloudflare-workers","deno","gleam-lang","hinoto","nodejs","webframework"],"latest_commit_sha":null,"homepage":"","language":"Gleam","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/Comamoca.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-24T07:40:19.000Z","updated_at":"2026-01-12T06:12:00.000Z","dependencies_parsed_at":"2025-09-24T09:39:32.525Z","dependency_job_id":null,"html_url":"https://github.com/Comamoca/hinoto","commit_stats":null,"previous_names":["comamoca/hinoto"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Comamoca/hinoto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comamoca%2Fhinoto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comamoca%2Fhinoto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comamoca%2Fhinoto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comamoca%2Fhinoto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Comamoca","download_url":"https://codeload.github.com/Comamoca/hinoto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comamoca%2Fhinoto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30325598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"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":["bun","cloudflare-workers","deno","gleam-lang","hinoto","nodejs","webframework"],"created_at":"2025-09-24T11:34:23.293Z","updated_at":"2026-03-10T05:02:15.705Z","avatar_url":"https://github.com/Comamoca.png","language":"Gleam","readme":"\u003cdiv align=\"center\"\u003e\n\n![Last commit](https://img.shields.io/github/last-commit/Comamoca/hinoto?style=flat-square)\n![Repository Stars](https://img.shields.io/github/stars/Comamoca/hinoto?style=flat-square)\n![Issues](https://img.shields.io/github/issues/Comamoca/hinoto?style=flat-square)\n![Open Issues](https://img.shields.io/github/issues-raw/Comamoca/hinoto?style=flat-square)\n![Bug Issues](https://img.shields.io/github/issues/Comamoca/hinoto/bug?style=flat-square)\n\n\u003cimg src=\"https://emoji2svg.deno.dev/api/🔥\" alt=\"fire\" height=\"100\"\u003e\n\n# Hinoto\n\nA web framework written in Gleam, designed for multiple JavaScript runtimes!\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003c/div\u003e\n\n## ✨ Features\n\n- 🌐 Support multi runtimes\\\n  Supports JavaScript runtimes (Node.js, Deno, Bun), CloudFlare Workers, and Erlang with Mist.\n- 🧩 Module first\\\n  Features are divided into modules, generating JavaScript that is advantageous for Tree-shaking. Additionally, no extra FFI code is mixed in during bundling.\n- 🔧 Custom context\\\n  The `Hinoto` type can contain arbitrary context, allowing runtime-specific information to be handled in the same way.\n- ⚡ Promise-based async (v2.0.0+)\\\n  JavaScript targets use Promise-based handlers for async operations, while Erlang remains synchronous.\n\n## 🚀 How to use\n\n### Node.js Example (v2.0.0+)\n\n```gleam\nimport gleam/http/request\nimport gleam/http/response\nimport gleam/javascript/promise\nimport gleam/option.{None}\nimport gleam/string\nimport hinoto\nimport hinoto/runtime/node\n\npub fn main() -\u003e Nil {\n  let fetch_handler =\n    node.handler(fn(hinoto_instance) {\n      use updated_hinoto \u003c- promise.await(\n        hinoto_instance\n        |\u003e hinoto.handle(handler),\n      )\n      promise.resolve(updated_hinoto)\n    })\n\n  node.start_server(fetch_handler, None, None)\n}\n\npub fn handler(req) {\n  case request.path_segments(req) {\n    [] -\u003e create_response(404, \"\u003ch1\u003eHello, Hinoto with Node.js!\u003c/h1\u003e\")\n    [\"greet\", name] -\u003e\n      create_response(200, string.concat([\"Hello! \", name, \"!\"]))\n    _ -\u003e create_response(404, \"\u003ch1\u003eNot Found\u003c/h1\u003e\")\n  }\n  |\u003e promise.resolve\n}\n\npub fn create_response(status: Int, html: String) {\n  response.new(status)\n  |\u003e response.set_body(html)\n  |\u003e response.set_header(\"content-type\", \"text/html\")\n}\n```\n\n### Cloudflare Workers Example (v2.0.0+)\n\n```gleam\nimport gleam/http/request\nimport gleam/http/response\nimport gleam/javascript/promise.{type Promise}\nimport gleam/string\nimport hinoto.{type Hinoto}\nimport hinoto/runtime/workers.{type WorkersContext}\n\npub fn main() {\n  workers.serve(fn(hinoto: Hinoto(WorkersContext, String)) -\u003e Promise(\n    Hinoto(WorkersContext, String),\n  ) {\n    use hinoto \u003c- promise.await(\n      hinoto\n      |\u003e hinoto.handle(handler),\n    )\n    promise.resolve(hinoto)\n  })\n}\n\npub fn handler(req) {\n  case request.path_segments(req) {\n    [] -\u003e\n      create_response(200, \"\u003ch1\u003eHello, Hinoto with Cloudflare Workers!\u003c/h1\u003e\")\n    _ -\u003e create_response(404, \"\u003ch1\u003eNot Found\u003c/h1\u003e\")\n  }\n  |\u003e promise.resolve\n}\n\npub fn create_response(status: Int, html: String) {\n  response.new(status)\n  |\u003e response.set_body(html)\n  |\u003e response.set_header(\"content-type\", \"text/html\")\n}\n```\n\n\n\u003e **Note**: v2.0.0 introduces Promise-based async handlers for JavaScript targets. See the [Migration Guide](#-migration-from-v1x-to-v20) below for upgrading from v1.x.\n\n## ⬇️ Install\n\nAdd dependencies for hinoto and hinoto_cli to the `dependencies` section of `gleam.toml`.\n\n```toml\nhinoto = { git = \"https://github.com/Comamoca/hinoto\", ref = \"main\" }\nhinoto_cli = { git = \"https://github.com/Comamoca/hinoto_cli\", ref = \"main\" }\n```\n\n```sh\ngleam run -m hinoto/cli -- workers init\nwrangler dev\n```\n\n## ⛏️ Development\n\nFor developing with various target JavaScript runtimes and CloudFlare Workers, `wrangler` is required.\n\n```sh\ncd example/\n\n# For CF Workers\ncd workers\nwrangler dev\n\n# For node.js\ncd node_server\n\n# For deno\ncd deno_server\n\n# For bun\ncd bun_server\n\n```\n\n## 📝 Todo\n\nSee [todo.md](./docs/todo.md)\n\n## Request Body Types by Runtime\n\nEach runtime uses an optimal body type for its environment:\n\n| Runtime | Body Type | Description |\n|---------|-----------|-------------|\n| **Mist (Erlang)** | `Connection` | Native streaming body support for efficient handling of large uploads |\n| **Node.js** | `String` | String-based bodies via Hinoto abstraction |\n| **Deno** | `JsRequest` | Runtime-specific type handled via FFI |\n| **Bun** | `JsRequest` | Runtime-specific type handled via FFI |\n| **Cloudflare Workers** | `String` | String-based bodies via Hinoto abstraction |\n\n**Why different types?**\n- **Erlang/Mist**: Uses `Connection` to support streaming request bodies, enabling efficient handling of large file uploads and chunked data\n- **JavaScript runtimes**: Use `String` or runtime-specific types for simpler, stateless request handling\n\n## 📜 License\n\nMIT\n\n### 🧩 Modules\n\n- [gleam_stdlib](https://hexdocs.pm/gleam_stdlib)\n- [gleam_javascript](https://hexdocs.pm/gleam_javascript)\n- [gleam_http](https://hexdocs.pm/gleam_http)\n\n## 👏 Affected projects\n\n- [glen](https://hexdocs.pm/glen/index.html)\n\n## 💕 Special Thanks\n\n- [Hono](https://hono.dev/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomamoca%2Fhinoto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomamoca%2Fhinoto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomamoca%2Fhinoto/lists"}