https://github.com/polyseam/inflate_response
https://github.com/polyseam/inflate_response
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/polyseam/inflate_response
- Owner: polyseam
- License: apache-2.0
- Created: 2024-02-01T19:23:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-16T23:16:27.000Z (over 1 year ago)
- Last Synced: 2025-06-03T16:06:22.903Z (about 1 year ago)
- Language: TypeScript
- Size: 36.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# inflate_response
This module leverages the
[Compression Streams API](https://deno.land/api?s=DecompressionStream) to
process an HTTP response which has been compressed with gzip or deflate, then
save it to disk.
## usage
```typescript
import { inflateResponse } from "https://deno.land/x/inflate_response/mod.ts";
const myGzippedContent = await fetch(
"https://example.com/some-gzipped-content.txt.gz",
);
// this will save the uncompressed or "inflated" content to a file named `some-gzipped-content.txt`
await inflateResponse(myGzippedContent, "./some-gzipped-content.txt");
```