{"id":18287086,"url":"https://github.com/deno-libs/http_compression","last_synced_at":"2025-04-05T08:31:36.488Z","repository":{"id":46533123,"uuid":"350368078","full_name":"deno-libs/http_compression","owner":"deno-libs","description":"🗜️ Deno HTTP compression middleware","archived":false,"fork":false,"pushed_at":"2023-03-23T21:31:43.000Z","size":44,"stargazers_count":38,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-04T00:06:24.041Z","etag":null,"topics":["compress","compression","deflate","deno","deno-server","gzip","http"],"latest_commit_sha":null,"homepage":"https://deno.land/x/http_compression","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/deno-libs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"ko_fi":"v1rtl","liberapay":"v1rtl","github":["talentlessguy"]}},"created_at":"2021-03-22T14:11:25.000Z","updated_at":"2024-08-04T00:06:29.509Z","dependencies_parsed_at":"2024-08-04T00:17:54.945Z","dependency_job_id":null,"html_url":"https://github.com/deno-libs/http_compression","commit_stats":null,"previous_names":["deno-libs/compression"],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-libs%2Fhttp_compression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-libs%2Fhttp_compression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-libs%2Fhttp_compression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-libs%2Fhttp_compression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deno-libs","download_url":"https://codeload.github.com/deno-libs/http_compression/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247311643,"owners_count":20918336,"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":["compress","compression","deflate","deno","deno-server","gzip","http"],"created_at":"2024-11-05T13:24:22.337Z","updated_at":"2025-04-05T08:31:36.451Z","avatar_url":"https://github.com/deno-libs.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n\n# http_compression\n\n[![nest badge][nest-badge]](https://nest.land/package/compression)\n[![GitHub Workflow Status][gh-actions-img]][github-actions]\n[![Codecov][cov-badge]][cov] [![][docs-badge]][docs]\n[![][code-quality-img]][code-quality]\n\n\u003c/div\u003e\n\nDeno HTTP compression middleware.\n\n## Features\n\n- `gzip`, `deflate` and `brotli` support\n- Detects supported encodings with `Accept-Encoding` header\n- Respects encodings order (depending on `Accept-Encoding` value)\n- Creates a `Content-Encoding` header with applied compression\n- Send `409 Not Acceptable` if encoding is not supported\n\n## Example\n\n```ts\nimport { compression } from 'https://deno.land/x/http_compression/mod.ts'\nimport { Server } from 'https://deno.land/http/server.ts'\n\nconst s = new Server({\n  handler: async (req) =\u003e {\n    return await compression({\n      path: 'README.md',\n      compression: ['br', 'gzip', 'deflate'],\n    })(req)\n  },\n  addr: ':3000',\n})\n\ns.listenAndServe()\n```\n\nNow try to send a `HEAD` request with `curl`:\n\n```sh\n$ curl localhost:3000 --head -H \"Accept-Encoding: br, gzip, deflate\" --compressed\nHTTP/1.1 200 OK\ncontent-length: 550\ncontent-encoding: br, gzip, deflate\n```\n\n[docs-badge]: https://img.shields.io/github/v/release/deno-libs/http_compression?label=Docs\u0026logo=deno\u0026style=for-the-badge\u0026color=black\n[docs]: https://doc.deno.land/https/deno.land/x/http_compression/mod.ts\n[gh-actions-img]: http://img.shields.io/github/actions/workflow/status/deno-libs/http_compression/main.yml?branch=master\u0026style=for-the-badge\u0026logo=github\u0026label=\u0026color=black\n[github-actions]: https://github.com/deno-libs/http_compression/actions\n[cov]: https://coveralls.io/github/deno-libs/http_compression\n[cov-badge]: https://img.shields.io/coveralls/github/deno-libs/http_compression?style=for-the-badge\u0026color=black\n[nest-badge]: https://img.shields.io/badge/publushed%20on-nest.land-black?style=for-the-badge\n[code-quality-img]: https://img.shields.io/codefactor/grade/github/deno-libs/http_compression?style=for-the-badge\u0026color=black\n[code-quality]: https://www.codefactor.io/repository/github/deno-libs/http_compression\n","funding_links":["https://ko-fi.com/v1rtl","https://liberapay.com/v1rtl","https://github.com/sponsors/talentlessguy"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeno-libs%2Fhttp_compression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeno-libs%2Fhttp_compression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeno-libs%2Fhttp_compression/lists"}