{"_id":"brotli-lib","_rev":"8-7814d50ac68459de334bdea952531830","name":"brotli-lib","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"brotli-lib","version":"0.0.1","keywords":["brotli","encode","decode","compress","decompress","compression","typescript","tree-shaking"],"author":{"name":"Jeremy Tribby, Countertype LLC"},"license":"MIT","_id":"brotli-lib@0.0.1","maintainers":[{"name":"tribby","email":"opensource@countertype.com"}],"dist":{"shasum":"d2b24c6dec741707e0606e573359b484b99a1c99","tarball":"https://registry.npmjs.org/brotli-lib/-/brotli-lib-0.0.1.tgz","fileCount":74,"integrity":"sha512-J9oNBZzc3GIsAj+UmM1pkKqqgF6SPAyl6IMMPOaoXQGGh65tWpaiGgRteyoX6qRGiHJkTmA0R/QEewTNmPyWRA==","signatures":[{"sig":"MEUCIAp66fwMNJy4NagfPXEpc2YwX+QGH3NSN7ONi/0zeFKdAiEAvkqSqBlHdFlmZ5iPXd5QuAIIjYcU12SkvdN1WVcMPrE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":963495},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./decode":{"types":"./dist/decode.d.ts","import":"./dist/decode.js","require":"./dist/decode.cjs"},"./encode":{"types":"./dist/encode.d.ts","import":"./dist/encode.js","require":"./dist/encode.cjs"}},"gitHead":"45e350fdc29cf6f0ab4663d5da19401eef66c5da","scripts":{"test":"vitest run","bench":"vitest bench","build":"rolldown -c && tsc --emitDeclarationOnly --declaration --outDir dist","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","bench:decode":"vitest bench bench/decode.bench.ts","bench:encode":"vitest bench bench/encode.bench.ts","prepublishOnly":"npm run clean && npm run test && npm run build"},"_npmUser":{"name":"tribby","email":"opensource@countertype.com"},"_npmVersion":"11.2.0","description":"TypeScript Brotli encoder and decoder","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"brotli":"^1.3.3","vitest":"^4.0.18","rolldown":"^1.0.0-beta.6","typescript":"^5.9.3","@types/node":"^25.1.0"},"_npmOperationalInternal":{"tmp":"tmp/brotli-lib_0.0.1_1770107925950_0.7054877682169323","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"brotli-lib","version":"0.0.2","keywords":["brotli","encode","decode","compress","decompress","compression","typescript","tree-shaking"],"author":{"name":"Jeremy Tribby, Countertype LLC"},"license":"MIT","_id":"brotli-lib@0.0.2","maintainers":[{"name":"tribby","email":"opensource@countertype.com"}],"dist":{"shasum":"e9596ac49dd33a768babaa287d97089a3517aced","tarball":"https://registry.npmjs.org/brotli-lib/-/brotli-lib-0.0.2.tgz","fileCount":74,"integrity":"sha512-4TZHrTnhnyiZ7Me8KC2GTV/J36kW4xtnPXlt68c6CY8MocJ1uljD9bkbue0mmAM8HVqUQWDhEFSiy3cNJM+Y+A==","signatures":[{"sig":"MEQCIGVfVQprPP5ccCiiS3MnhoY/r+JQwAgwDkR3eCtv8k+yAiAGWK454txvJ4jF/wcCufxN7FzuqCre/oYCV4fa3jqYfw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":969978},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./decode":{"types":"./dist/decode.d.ts","import":"./dist/decode.js","require":"./dist/decode.cjs"},"./encode":{"types":"./dist/encode.d.ts","import":"./dist/encode.js","require":"./dist/encode.cjs"}},"gitHead":"bdf7c4d7f8a45cc1ec49f87034a1405d6a9ba1af","scripts":{"test":"vitest run","bench":"vitest bench","build":"rolldown -c && tsc --emitDeclarationOnly --declaration --outDir dist","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","bench:decode":"vitest bench bench/decode.bench.ts","bench:encode":"vitest bench bench/encode.bench.ts","prepublishOnly":"npm run clean && npm run test && npm run build"},"_npmUser":{"name":"tribby","email":"opensource@countertype.com"},"_npmVersion":"11.2.0","description":"TypeScript Brotli encoder and decoder","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"brotli":"^1.3.3","vitest":"^4.0.18","rolldown":"^1.0.0-beta.6","typescript":"^5.9.3","@types/node":"^25.1.0"},"_npmOperationalInternal":{"tmp":"tmp/brotli-lib_0.0.2_1770118489361_0.703557503840718","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"brotli-lib","version":"0.0.3","keywords":["brotli","encode","decode","compress","decompress","compression","typescript","tree-shaking"],"author":{"name":"Jeremy Tribby, Countertype LLC"},"license":"MIT","_id":"brotli-lib@0.0.3","maintainers":[{"name":"tribby","email":"opensource@countertype.com"}],"dist":{"shasum":"fc850b4c1639247b5a758eadfc15ae764b791660","tarball":"https://registry.npmjs.org/brotli-lib/-/brotli-lib-0.0.3.tgz","fileCount":74,"integrity":"sha512-ng0O3t0ko+u1DiZA3iK62fw0r5Fce17GpfYBZkVR1zz/L43j7NtNinXH5tQNKgBYK31O2GI6n4KsleEYsy5qCw==","signatures":[{"sig":"MEQCIFF2eO3ravTGCpZLszH9XtkWEaU8jrGGCU7ZIvw8FSkDAiADbJjN7hjrkqGSHz9UjONpN3Qitq8vlVRkPzeVZHDWqQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1155110},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./decode":{"types":"./dist/decode.d.ts","import":"./dist/decode.js","require":"./dist/decode.cjs"},"./encode":{"types":"./dist/encode.d.ts","import":"./dist/encode.js","require":"./dist/encode.cjs"}},"gitHead":"9f8ad7d094e9ff5f47bd5682e8fe9336de8fdf25","scripts":{"test":"vitest run","bench":"vitest bench","build":"rolldown -c && tsc --emitDeclarationOnly --declaration --outDir dist","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","bench:decode":"vitest bench bench/decode.bench.ts","bench:encode":"vitest bench bench/encode.bench.ts","prepublishOnly":"npm run clean && npm run test && npm run build"},"_npmUser":{"name":"tribby","email":"opensource@countertype.com"},"_npmVersion":"11.2.0","description":"TypeScript Brotli encoder and decoder","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"brotli":"^1.3.3","vitest":"^4.0.18","rolldown":"^1.0.0-beta.6","typescript":"^5.9.3","@types/node":"^25.1.0"},"_npmOperationalInternal":{"tmp":"tmp/brotli-lib_0.0.3_1770174607707_0.29282762852941446","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"brotli-lib","version":"0.0.4","keywords":["brotli","encode","decode","compress","decompress","compression","typescript","tree-shaking"],"author":{"name":"Jeremy Tribby, Countertype LLC"},"license":"MIT","_id":"brotli-lib@0.0.4","maintainers":[{"name":"tribby","email":"opensource@countertype.com"}],"dist":{"shasum":"1294762e1d14462efe91aa6a3e169f4c9ab7dc9e","tarball":"https://registry.npmjs.org/brotli-lib/-/brotli-lib-0.0.4.tgz","fileCount":74,"integrity":"sha512-vroY/D55Ab8HBlunr9llwZDg0E+pHbxxfNgZJ196rGWg5IX8ZQSqYjdoo1gNsk0d5EX8BeAraep8sDOUVeIY5A==","signatures":[{"sig":"MEUCIQDwxiWOFcrv8VJtyksIuAxUoQWDiDUJNBH0nnCLa52YSAIgfBCtuQx+ZUxsYcDrsY4ADUWGvgnIckZxRmZ0ppJmd3M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1159744},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./decode":{"types":"./dist/decode.d.ts","import":"./dist/decode.js","require":"./dist/decode.cjs"},"./encode":{"types":"./dist/encode.d.ts","import":"./dist/encode.js","require":"./dist/encode.cjs"}},"gitHead":"7c922d7b3706ef1360b137fd0eceea2013a9afb4","scripts":{"test":"vitest run","bench":"vitest bench","build":"rolldown -c && tsc --emitDeclarationOnly --declaration --outDir dist","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","bench:decode":"vitest bench bench/decode.bench.ts","bench:encode":"vitest bench bench/encode.bench.ts","prepublishOnly":"npm run clean && npm run test && npm run build"},"_npmUser":{"name":"tribby","email":"opensource@countertype.com"},"_npmVersion":"11.2.0","description":"TypeScript Brotli encoder and decoder","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"brotli":"^1.3.3","vitest":"^4.0.18","rolldown":"^1.0.0-beta.6","typescript":"^5.9.3","@types/node":"^25.1.0"},"_npmOperationalInternal":{"tmp":"tmp/brotli-lib_0.0.4_1770418405463_0.23140806151113535","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"brotli-lib","version":"0.0.6","keywords":["brotli","encode","decode","compress","decompress","compression","typescript","tree-shaking"],"author":{"name":"Jeremy Tribby, Countertype LLC"},"license":"MIT","_id":"brotli-lib@0.0.6","maintainers":[{"name":"tribby","email":"opensource@countertype.com"}],"dist":{"shasum":"798f5b85dfb41d97e196659a3c291a630950f9ee","tarball":"https://registry.npmjs.org/brotli-lib/-/brotli-lib-0.0.6.tgz","fileCount":74,"integrity":"sha512-hYHoQCVVcwX+T2ZgxgCY6QY4B5STyw1NpIMCL1WOzQGrNlua0OV08tM7Ia1qz9eZa0wn5C/pdwOS8O/aoTKN8Q==","signatures":[{"sig":"MEQCIHv+wMvZizEczPnCNHHgirhUIrE4mMTQQ0iFH8L6hCtcAiAgxvzF6ejKwGastCgw939lWCUpIbOoiVwRRB6auLwqkQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1142721},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./decode":{"types":"./dist/decode.d.ts","import":"./dist/decode.js","require":"./dist/decode.cjs"},"./encode":{"types":"./dist/encode.d.ts","import":"./dist/encode.js","require":"./dist/encode.cjs"}},"gitHead":"53730db2ec09b6ded3dbffb16e46a60df8dc56fb","scripts":{"test":"vitest run","bench":"vitest bench","build":"rolldown -c && tsc --emitDeclarationOnly --declaration --outDir dist","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","bench:decode":"vitest bench bench/decode.bench.ts","bench:encode":"vitest bench bench/encode.bench.ts","prepublishOnly":"npm run clean && npm run test && npm run build"},"_npmUser":{"name":"tribby","email":"opensource@countertype.com"},"_npmVersion":"11.2.0","description":"TypeScript Brotli encoder and decoder","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"brotli":"^1.3.3","vitest":"^4.0.18","rolldown":"^1.0.0-beta.6","typescript":"^5.9.3","@types/node":"^25.1.0"},"_npmOperationalInternal":{"tmp":"tmp/brotli-lib_0.0.6_1770502910472_0.9858950220068472","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"brotli-lib","version":"0.0.7","keywords":["brotli","encode","decode","compress","decompress","compression","typescript","tree-shaking"],"author":{"name":"Jeremy Tribby, Countertype LLC"},"license":"MIT","_id":"brotli-lib@0.0.7","maintainers":[{"name":"tribby","email":"opensource@countertype.com"}],"dist":{"shasum":"7a9d1911b83c5a170c5bb5054974b8534d3bc278","tarball":"https://registry.npmjs.org/brotli-lib/-/brotli-lib-0.0.7.tgz","fileCount":74,"integrity":"sha512-ph4vAFd0gGa9nl94BeFLnjsWt3XfpRD6dPoUWPLrj3GO6qcx2pb7S/2O2zwxt2+a4Co5+cMBuPgj/N0zUo+pvw==","signatures":[{"sig":"MEUCIQCDcBXa3AjqiVpgMhlJ1x6LC+OFO3E0wXfwgziwJBbfFAIgIB5W2g9aAaVSo6z9TN+fxOUVcd6g3Q+ileRkVOUv9D0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1161411},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./decode":{"types":"./dist/decode.d.ts","import":"./dist/decode.js","require":"./dist/decode.cjs"},"./encode":{"types":"./dist/encode.d.ts","import":"./dist/encode.js","require":"./dist/encode.cjs"}},"gitHead":"3d06ebb275200946386bef1068830f639872d2be","scripts":{"test":"vitest run","bench":"vitest bench","build":"rolldown -c && tsc --emitDeclarationOnly --declaration --outDir dist","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","bench:decode":"vitest bench bench/decode.bench.ts","bench:encode":"vitest bench bench/encode.bench.ts","prepublishOnly":"npm run clean && npm run test && npm run build"},"_npmUser":{"name":"tribby","email":"opensource@countertype.com"},"_npmVersion":"11.2.0","description":"TypeScript Brotli encoder and decoder","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"brotli":"^1.3.3","vitest":"^4.0.18","rolldown":"^1.0.0-beta.6","typescript":"^5.9.3","@types/node":"^25.1.0"},"_npmOperationalInternal":{"tmp":"tmp/brotli-lib_0.0.7_1770873134153_0.8243211223182279","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"brotli-lib","version":"0.1.0","keywords":["brotli","encode","decode","compress","decompress","compression","typescript","tree-shaking"],"author":{"name":"Jeremy Tribby, Countertype LLC"},"license":"MIT","_id":"brotli-lib@0.1.0","maintainers":[{"name":"tribby","email":"opensource@countertype.com"}],"dist":{"shasum":"c784a9f9e6fd36379da27b9ef9970fbf8f1fb6d6","tarball":"https://registry.npmjs.org/brotli-lib/-/brotli-lib-0.1.0.tgz","fileCount":92,"integrity":"sha512-MQuHoDNnf/tpMxVZs2tKhd/JI85bPw8dkNRX3YN4++VHzAacZ4kktnxB201Woh61Mq3HRhxaZHKKYHEemnyC5w==","signatures":[{"sig":"MEYCIQC+rWttE6Mkvg+L9dnNXSZJtG2Y+F+eKf160BmR8vsx7wIhAM08TFv1SlxcebL+b7lG9Mic5MISK7tlBP+ftLwdAgbP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCPt01qH86rGl51JO5NtMQryZMPcCb/JY/1NFuYs0QwPQIgOfBXby8w9SlaNokP8fbrpryzlm+jjvAm+lRicrY/bZE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1951675},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./decode":{"types":"./dist/decode.d.ts","import":"./dist/decode.js","require":"./dist/decode.cjs"},"./encode":{"types":"./dist/encode.d.ts","import":"./dist/encode.js","require":"./dist/encode.cjs"},"./encode-no-dict":{"types":"./dist/encode-no-dict.d.ts","import":"./dist/encode-no-dict.js","require":"./dist/encode-no-dict.cjs"}},"gitHead":"87747a1c3c7a1e76f8bb7cad717eca3cc1d2c0cb","scripts":{"fuzz":"npm run build && node test/fuzz.mjs","test":"vitest run","bench":"vitest bench","build":"rolldown -c && tsc --emitDeclarationOnly --declaration --outDir dist","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","bench:decode":"vitest bench bench/decode.bench.ts","bench:encode":"vitest bench bench/encode.bench.ts","prepublishOnly":"npm run clean && npm run test && npm run build"},"_npmUser":{"name":"tribby","email":"opensource@countertype.com"},"_npmVersion":"10.9.4","description":"TypeScript Brotli encoder and decoder","directories":{},"sideEffects":false,"_nodeVersion":"22.22.1","_hasShrinkwrap":false,"devDependencies":{"brotli":"^1.3.3","vitest":"^4.0.18","rolldown":"^1.0.0-beta.6","typescript":"^5.9.3","@types/node":"^25.1.0"},"_npmOperationalInternal":{"tmp":"tmp/brotli-lib_0.1.0_1795132039644_0.3887476602397101","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"brotli-lib@0.1.1","dist":{"shasum":"0efc7bb68912b367ef3434faba0f55143c03598e","tarball":"https://registry.npmjs.org/brotli-lib/-/brotli-lib-0.1.1.tgz","fileCount":92,"integrity":"sha512-cUUWFydSRbf9NltbIcuZHJ+4SvyXb8DvEMiCV/0jEuoDYpP6OE/gpvt4tFg8C48aDZyAOHwo3usZVe1EaYEv8w==","signatures":[{"sig":"MEYCIQC9HPMNORHk3dPUXp4mfEaZtb4ny7SQcIht28q9LBUaQgIhAOqaX+0ekecKP1GyEUTLOJMU5QqdHU2XVKrZGtYhVeGa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHUEmDczcqLxX0ZWvFjdH5rY/epMQ9f25lNRFbzO3gBNAiApAgra/1C3Htuez446b3s2gqeBmvIUuKzUaWhYqQW0QQ=="}],"unpackedSize":1918275},"main":"dist/index.cjs","name":"brotli-lib","type":"module","types":"dist/index.d.ts","author":{"name":"Jeremy Tribby, Countertype LLC"},"module":"dist/index.js","engines":{"node":">=12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./decode":{"types":"./dist/decode.d.ts","import":"./dist/decode.js","require":"./dist/decode.cjs"},"./encode":{"types":"./dist/encode.d.ts","import":"./dist/encode.js","require":"./dist/encode.cjs"},"./encode-no-dict":{"types":"./dist/encode-no-dict.d.ts","import":"./dist/encode-no-dict.js","require":"./dist/encode-no-dict.cjs"}},"gitHead":"ef02ebf1eef0121f55215c8f5933411628132c9f","license":"MIT","scripts":{"fuzz":"npm run build && node test/fuzz.mjs","test":"vitest run","bench":"npm run build && vitest bench --reporter=verbose","build":"rolldown -c && tsc --emitDeclarationOnly --declaration --outDir dist","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","bench:decode":"npm run build && vitest bench --reporter=verbose bench/decode.bench.ts","bench:encode":"npm run build && vitest bench --reporter=verbose bench/encode.bench.ts","prepublishOnly":"npm run clean && npm run test && npm run build"},"version":"0.1.1","_npmUser":{"name":"tribby","email":"opensource@countertype.com"},"keywords":["brotli","encode","decode","compress","decompress","compression","typescript","tree-shaking"],"_npmVersion":"10.9.4","description":"TypeScript Brotli encoder and decoder","directories":{},"maintainers":[{"name":"tribby","email":"opensource@countertype.com"}],"sideEffects":false,"_nodeVersion":"22.22.1","_hasShrinkwrap":false,"devDependencies":{"brotli":"^2.1.0","vitest":"^5.1.1","rolldown":"^1.3.3","typescript":"^7.0.2","@types/node":"^26.6.6"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/brotli-lib_0.1.1_1795135530427_0.9456764500063187"}}},"time":{"created":"2026-02-03T08:38:45.949Z","modified":"2026-11-20T00:45:30.779Z","0.0.1":"2026-02-03T08:38:46.188Z","0.0.2":"2026-02-03T11:34:49.549Z","0.0.3":"2026-02-04T03:10:07.867Z","0.0.4":"2026-02-06T22:53:25.688Z","0.0.6":"2026-02-07T22:21:50.712Z","0.0.7":"2026-02-12T05:12:14.313Z","0.1.0":"2026-11-19T23:47:19.815Z","0.1.1":"2026-11-20T00:45:30.523Z"},"author":{"name":"Jeremy Tribby, Countertype LLC"},"license":"MIT","keywords":["brotli","encode","decode","compress","decompress","compression","typescript","tree-shaking"],"description":"TypeScript Brotli encoder and decoder","maintainers":[{"name":"tribby","email":"opensource@countertype.com"}],"readme":"# brotli-lib\n\n[![npm version](https://img.shields.io/npm/v/brotli-lib)](https://www.npmjs.com/package/brotli-lib)\n\nTypeScript Brotli encoder and decoder\n\n## Install\n\n```bash\nnpm install brotli-lib\n```\n\n## Usage\n\n```typescript\nimport { brotliDecode } from 'brotli-lib/decode'\n\nconst decompressed = brotliDecode(compressed)\n```\n\n```typescript\nimport { brotliEncode } from 'brotli-lib/encode'\n\nconst compressed = brotliEncode(data, { quality: 11 })\n```\n\n```typescript\nimport { brotliEncode, brotliDecode } from 'brotli-lib'\n```\n\n```typescript\n// Same encoder without the static dictionary: a third of the size\nimport { brotliEncode } from 'brotli-lib/encode-no-dict'\n```\n\n## API\n\n### Decode\n\n```typescript\nfunction brotliDecode(\n  data: Uint8Array,\n  options?: { maxOutputSize?: number; customDictionary?: Uint8Array }\n): Uint8Array\n\nfunction brotliDecodedSize(data: Uint8Array): number  // -1 if multi-metablock\n```\n\n### Encode\n\n```typescript\nfunction brotliEncode(\n  data: Uint8Array,\n  options?: {\n    quality?: number   // 0-11, default 11\n    lgwin?: number     // window bits 10-24, default 22\n    mode?: EncoderMode // GENERIC, TEXT, or FONT\n  }\n): Uint8Array\n\nclass BrotliEncoder {\n  constructor(options?: BrotliEncodeOptions)\n  update(chunk: Uint8Array): Uint8Array  // output ready so far, possibly empty\n  finish(): Uint8Array                   // the rest of the stream\n}\n```\n\n`BrotliEncoder` takes input in chunks of any size and compresses to within a fraction of a percent of `brotliEncode` at the same quality. Output is produced a metablock at a time, so `update` often returns an empty array; concatenate everything `update` and `finish` return\n\nFONT mode uses distance coding parameters optimized for transformed font data. It doesn't improve compression on raw TTF/OTF files - the gains come from WOFF2's font-specific transforms (glyf, loca, hmtx) applied before brotli compression\n\n## Performance\n\n### Decode\n\n|  | brotli-lib | brotli.js | Google decode.ts |\n|--|------------|-----------|---------------|\n| Speed (vs Google) | 1.3x | 0.6x | 1x |\n| Custom dictionary | yes | no | yes |\n| Compressed static dict | yes | yes | no |\n\nDecode times (Apple M2 Max, Node 22):\n\n| File | brotli-lib | brotli.js | Google decode.ts |\n|------|------------|-----------|---------------|\n| enc-ttf (305 KB) | 2.3 ms | 5.0 ms | 3.0 ms |\n| enc-otf (253 KB) | 2.2 ms | 4.7 ms | 2.8 ms |\n| enc-var-ttf (788 KB) | 5.7 ms | 12.6 ms | 7.4 ms |\n| noto-tc (7 MB) | 46 ms | 99 ms | 60 ms |\n\n2x faster than brotli.js, ~30% faster than Google's JS decoder. Node's native `zlib.brotliDecompressSync` is faster still: on these files it takes 1.4 to 1.5 ms, 3.9 ms and 33 ms, so warm decode here costs about 1.4 to 1.6 times native. The first call in a process also pays JIT warm-up (about 25 ms for a 300 KB font)\n\nRun `npm run bench` to reproduce\n\n### Encode\n\nOutput size and time against Node.js native `zlib.brotliCompressSync`, which is Google's C encoder, at the same quality. Size is relative to native output; negative is smaller\n\n| Quality | Text size | Text time | Font size | Font time |\n|---------|-----------|-----------|-----------|-----------|\n| 2 | +0.3 to +0.5% | 3.5-4.5x | -0.7 to -0.6% | 3.5x |\n| 5 | -1.7 to -1.6% | 3.5-4.5x | +0.1 to +0.9% | 3.5x |\n| 9 | -1.7 to -1.6% | 3.5-4x | -5.0 to -3.6% | 6-8x |\n| 11 | 0 to +0.1% | 2x | +0.3 to +0.5% | 2x |\n\nText is alice29.txt (149 KB) and lcet10.txt (417 KB) from the Canterbury corpus; fonts are enc-ttf and enc-otf from the decode table. Time is a multiple of native, warm, and moves by a few tenths from run to run\n\nAbsolute times at quality 11: 350 ms for alice29.txt, 1.1 s for lcet10.txt, 1.4 to 1.5 s for either font. At quality 5: 11 ms, 25 ms and 20 to 24 ms\n\nAt qualities 7 to 9 binary input gets literal context modelling that the C encoder leaves out, which is where the smaller fonts and the extra time both come from\n\nTiny inputs are much faster than native at any quality, since there is no binding overhead: a 13-byte input takes 0.0002 ms against 0.15 ms at quality 11. Inputs of a few KB take 0.03 to 0.08 ms at quality 5 to 9, about 2.5 to 4 times native\n\n## Subpath exports\n\n| Import | Export size (gzip) |\n|--------|--------------------|\n| `brotli-lib/decode` | 67 KB |\n| `brotli-lib/encode` | 103 KB |\n| `brotli-lib/encode-no-dict` | 31 KB |\n| `brotli-lib` | 102 KB |\n\nThe 122 KB static dictionary is compressed to 52 KB and bootstrapped at runtime (à la Devon Govett's brotli.js). The encoder matches against the dictionary too, so `brotli-lib/encode` carries it along with the decoder that unpacks it; importing both costs nothing extra\n\n`brotli-lib/encode-no-dict` is the same encoder and API with dictionary matching left out. Its output is ordinary brotli that any decoder reads. What it gives up, measured against `brotli-lib/encode`:\n\n| Input | Quality 5 and 9 | Quality 11 |\n|-------|-----------------|------------|\n| Fonts | nothing | under 0.5% either way |\n| JSON, source code | 0.2 to 1% larger | 1 to 3% larger |\n| Prose | about 0.5% larger | 3.5 to 5% larger |\n| Short HTML (under a few KB) | 30 to 45% larger | 55 to 75% larger |\n\nUse it for fonts and other binary data, or wherever bundle size matters more than the last few percent. Keep the default for short text, where the dictionary does most of the work\n\n## License\n\nMIT\n\nDerived from Google's [brotli](https://github.com/google/brotli) (MIT)\n\nMaintained by [@jpt](https://github.com/jpt)\n","readmeFilename":"README.md"}