{"id":28842910,"url":"https://github.com/nberlette/brotli","last_synced_at":"2026-02-16T09:08:35.423Z","repository":{"id":282527368,"uuid":"865741762","full_name":"nberlette/brotli","owner":"nberlette","description":"Lightweight brotli decompressor, powered by WebAssembly.","archived":false,"fork":false,"pushed_at":"2025-03-19T19:07:09.000Z","size":270,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T00:09:40.595Z","etag":null,"topics":["brotli","brotli-decoder","brotli-decompressor","decompressor","deno","jsr","rust","typescript","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://jsr.io/@nick/brotli","language":"Rust","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/nberlette.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"ko_fi":"nberlette"}},"created_at":"2024-10-01T03:50:22.000Z","updated_at":"2025-03-19T15:51:00.000Z","dependencies_parsed_at":"2025-09-11T17:32:16.999Z","dependency_job_id":"a521daf0-3ee4-47a2-8f45-5323f0b795c3","html_url":"https://github.com/nberlette/brotli","commit_stats":null,"previous_names":["nberlette/brotli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nberlette/brotli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nberlette%2Fbrotli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nberlette%2Fbrotli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nberlette%2Fbrotli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nberlette%2Fbrotli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nberlette","download_url":"https://codeload.github.com/nberlette/brotli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nberlette%2Fbrotli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29504688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["brotli","brotli-decoder","brotli-decompressor","decompressor","deno","jsr","rust","typescript","wasm","webassembly"],"created_at":"2025-06-19T16:08:07.724Z","updated_at":"2026-02-16T09:08:35.409Z","avatar_url":"https://github.com/nberlette.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n\n# [`@nick/brotli`][JSR]\n\n\u003cbig\u003e\u003cb\u003eLightweight [brotli] decompressor, powered by WebAssembly.\u003c/b\u003e\u003c/big\u003e\n\n\u003csmall\u003e\u003cb\u003eSupported by Deno, Bun, Node, modern browsers, and more.\u003c/b\u003e\u003c/small\u003e\n\n[![][badge-jsr-score]][badge-jsr-score] [![][badge-jsr-pkg]][badge-jsr-pkg]\n\n\u003c/div\u003e\n\n---\n\nThis module provides a blazing-fast [brotli] decompressor, written in Rust and\ncompiled to WebAssembly. It's compatibile with virtually any runtime supportive\nof WebAssembly, including [Deno], [Bun], [Node], [Cloudflare Workers], and all\nrecent releases of modern browsers (Chrome, Firefox, Safari, Edge, etc.).\n\n## Install\n\n```sh\ndeno add jsr:@nick/brotli\n```\n\n```sh\nnpx jsr add @nick/brotli\n```\n\n```sh\nbunx jsr add @nick/brotli\n```\n\n```sh\npnpm dlx jsr add @nick/brotli\n```\n\n```sh\nyarn dlx jsr add @nick/brotli\n```\n\n---\n\n## Usage\n\n```ts\nimport { decompress } from \"@nick/brotli\";\n\nconst res = await fetch(\"file:///compressed.txt.br\");\nconst small = await res.bytes();\n\nconst large = decompress(small); // \u003c- synchronous\n\nconsole.log(`Decompressed ${small.length}B -\u003e ${large.length}B`);\n```\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e The `decompress` function is pre-initialized and ready for immediate use.\n\n---\n\n## Overview\n\nUnder the hood on the Rust side of the codebase, this is a thin wrapper of the\nthird-party [brotli-decompressor] crate, adding WebAssembly bindings and some\ngraceful error handling[^1].\n\nOn the JavaScript side of the codebase, it adds support for several additional\ninput types, allowing you to decompress data from a string, `ArrayBuffer`, or\nany `ArrayBufferView` object, including `DataView` and all typed array types.\nThis results in a **very** similar signature to that of `brotliDecompressSync`\nfrom the native `node:zlib` module, giving you the ability to use this module as\nan almost-drop-in replacement for it in _most_ situations.\n\n\u003e [!NOTE]\n\u003e\n\u003e This tool does not use the Node `Buffer` API, which is from a time when the\n\u003e JavaScript ecosystem didn't have a standardized way to represent binary data.\n\u003e Instead we use its superclass - the universally-supported `Uint8Array` type.\n\n[^1]: The error handling is a bit more graceful than the original crate, but it\n    might not be what you're looking for: in the case of erroneous input data\n    (or data that is not compressed with Brotli), the `decompress` function will\n    simply return the same input data (but always as a `Uint8Array`).\n\n---\n\n### Prior Art\n\n- [brotli-wasm]\n- [brotli-dec-wasm]\n- [brotli-decompressor]\n\n\u003e [!TIP]\n\u003e\n\u003e **Shameless Plug**: If you're looking for a non-WebAssembly Brotli\n\u003e decompressor, I've also published [brocha], a 100% JS decompressor that weighs\n\u003e in at under 200KB. While it's not quite as fast as WASM, it benchmarks\n\u003e extremely well in comparison to other JS-based solutions.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cbig\u003e\u003cstrong\u003e[MIT] © [Nicholas Berlette]. All rights reserved.\u003c/strong\u003e\u003c/big\u003e\n\n\u003csmall\u003e\u003cstrong\u003e[GitHub] • [Issues] • [JSR] • [NPM] • [brocha]\u003c/strong\u003e\u003c/small\u003e\n\n\u003cbr\u003e\n\n[![JSR][badge-jsr]][JSR] [![JSR][badge-jsr-score]][JSR] [![NPM][badge-npm]][NPM]\n\n\u003c/div\u003e\n\n[brocha]: https://jsr.io/@nick/brocha \"View the @nick/brocha project on jsr.io\"\n[brotli]: https://github.com/google/brotli \"View the google/brotli project on GitHub\"\n[MIT]: https://nick.mit-license.org \"MIT © 2024+ Nicholas Berlette. All rights reserved.\"\n[Nicholas Berlette]: https://github.com/nberlette \"Nicholas Berlette on GitHub\"\n[GitHub]: https://github.com/nberlette/brotli \"View the @nick/brotli project on GitHub\"\n[Issues]: https://github.com/nberlette/brotli/issues \"View issues for the @nick/brotli project on GitHub\"\n[JSR]: https://jsr.io/@nick/brotli/doc \"View the @nick/brotli documentation on jsr.io\"\n[NPM]: https://www.npmjs.com/package/debrotli \"View the @nberlette/brotli package on npm\"\n[brotli-decompressor]: https://crates.io/crates/brotli-decompressor \"View the brotli-decompressor crate on crates.io\"\n[brotli-wasm]: https://crates.io/brotli-wasm \"View the brotli-wasm crate on crates.io\"\n[brotli-dec-wasm]: https://crates.io/brotli-dec-wasm \"View the brotli-dec-wasm crate on crates.io\"\n[badge-npm]: https://img.shields.io/badge/debrotli-tomato.svg?logoWidth=32\u0026logoColor=white\u0026color=firebrick\u0026logo=data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzLjExZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIC0yNSA1MTIgMTkwIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMTU3LjUzOCAxNjQuMTAzaDY1LjY0MXYtMzIuODJoNjUuNjQyVjBIMTU3LjUzOHpNMjIzLjE4IDMyLjgySDI1NnY2NS42NGgtMzIuODJ6TTMxNS4wNzcgMHYxMzEuMjgyaDY1LjY0VjMyLjgyMWgzMi44MjF2OTguNDYxaDMyLjgyMVYzMi44MjFoMzIuODJ2OTguNDYxSDUxMlYwek0wIDEzMS4yODJoNjUuNjQxVjMyLjgyMWgzMi44MnY5OC40NjFoMzIuODIxVjBIMHoiLz48L3N2Zz4= \"View @nberlette/brotli on npm\"\n[badge-jsr]: https://jsr.io/badges/@nick \"View all of @nick's packages on jsr.io\"\n[badge-jsr-pkg]: https://jsr.io/badges/@nick/brotli \"View @nick/brotli on jsr.io\"\n[badge-jsr-score]: https://jsr.io/badges/@nick/brotli/score \"View the score for @nick/brotli on jsr.io\"\n[Deno]: https://deno.land \"Deno - A modern JavaScript and TypeScript runtime\"\n[Bun]: https://bun.sh \"Bun - A fast all-in-one JavaScript runtime\"\n[Node]: https://nodejs.org \"Node.js - A JavaScript runtime built on Chrome's V8 JavaScript engine\"\n[Cloudflare Workers]: https://workers.cloudflare.com \"Cloudflare Workers serverless execution environment\"\n","funding_links":["https://ko-fi.com/nberlette"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnberlette%2Fbrotli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnberlette%2Fbrotli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnberlette%2Fbrotli/lists"}