{"id":15447857,"url":"https://github.com/hazae41/fleche","last_synced_at":"2025-04-19T21:37:02.091Z","repository":{"id":65205124,"uuid":"586317628","full_name":"hazae41/fleche","owner":"hazae41","description":"Zero-copy HTTP protocol for the web 🏎️ (JS + WebAssembly)","archived":false,"fork":false,"pushed_at":"2024-09-01T15:52:12.000Z","size":791,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-19T09:21:14.000Z","etag":null,"topics":["browser","deno","fetch","gzip","http","javascript","protocol","quic","rpc","typescript","webassembly","webstream","webstreams","zero-copy"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/hazae41.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["hazae41"],"patreon":"hazae41"}},"created_at":"2023-01-07T17:55:10.000Z","updated_at":"2024-10-16T12:43:41.000Z","dependencies_parsed_at":"2023-11-11T00:22:06.584Z","dependency_job_id":"de95e553-a645-437a-8e76-a32d06d088c7","html_url":"https://github.com/hazae41/fleche","commit_stats":null,"previous_names":[],"tags_count":111,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Ffleche","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Ffleche/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Ffleche/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Ffleche/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hazae41","download_url":"https://codeload.github.com/hazae41/fleche/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241604979,"owners_count":19989603,"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":["browser","deno","fetch","gzip","http","javascript","protocol","quic","rpc","typescript","webassembly","webstream","webstreams","zero-copy"],"created_at":"2024-10-01T20:20:39.482Z","updated_at":"2025-03-03T03:30:37.947Z","avatar_url":"https://github.com/hazae41.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/4405263/219943458-f5fa0f94-8dfd-4f8e-9fb5-df780a600dd4.png\" /\u003e\n\u003c/div\u003e\n\n```bash\nnpm i @hazae41/fleche\n```\n\n[**Node Package 📦**](https://www.npmjs.com/package/@hazae41/fleche)\n\n## Features\n\n### Goals\n- 100% TypeScript and ESM\n- Zero-copy reading and writing\n- Transport agnostic (TCP, TLS, Tor)\n- Supports backpressure\n\n### HTTP\n- HTTP 1.1\n- Native Gzip and Deflate compression\n- Compatible with code using `fetch`\n- Reusable underlying connection\n\n### WebSocket\n- Relies on the above HTTP\n- Powered by WebAssembly\n- Same API than native\n- Only 0.3ms slower than native\n\n### [Upcoming features](https://github.com/sponsors/hazae41)\n- More HTTP 1.1 features\n- HTTP 2, HTTP 3 (QUIC)\n\n## Usage\n\n```tsx\nimport { Opaque, Writable } from \"@hazae41/binary\"\nimport { fetch } from \"@hazae41/fleche\"\n\nfunction example(stream: ReadableWritablePair\u003cOpaque, Writable\u003e) {\n  /**\n   * Fetch using the underlying TCP or TLS stream\n   */\n  const res = await fetch(\"https://example.com\", { stream })\n\n  if (!res.ok)\n    throw new Error(await res.text())\n\n  return await res.json()\n}\n```\n\n```tsx\nimport { Opaque, Writable } from \"@hazae41/binary\"\nimport { WebSocket } from \"@hazae41/fleche\"\n\nfunction example(stream: ReadableWritablePair\u003cOpaque, Writable\u003e) {\n  const socket = new WebSocket(\"wss://example.com\")\n\n  /**\n   * Pipe TCP or TLS input to WebSocket input\n   */\n  stream.readable\n    .pipeTo(socket.inner.writable, { preventCancel: true })\n    .catch(() =\u003e {})\n\n  /**\n   * Pipe WebSocket output to TCP or TLS output\n   */\n  socket.inner.readable\n    .pipeTo(stream.writable, { preventClose: true, preventAbort: true })\n    .catch(() =\u003e {})\n\n  await new Promise((ok, err) =\u003e {\n    socket.addEventListener(\"open\", ok)\n    socket.addEventListener(\"error\", err)\n  })\n\n  socket.addEventListener(\"message\", e =\u003e console.log(e.data))\n  socket.send(\"Hello world\")\n}\n","funding_links":["https://github.com/sponsors/hazae41","https://patreon.com/hazae41"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazae41%2Ffleche","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazae41%2Ffleche","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazae41%2Ffleche/lists"}