docs: improve README with updated usage examples
Summary
This PR improves the README.md by adding a clear and minimal TypeScript usage example, aligning with the plugin's existing TypeScript support.
What's Changed
- Added a dedicated section for TypeScript usage
- Included a type-safe compression example with
reply.compress - Ensured consistency with the rest of the documentation
Motivation
Many developers using Fastify rely on TypeScript. While the plugin is compatible, the README lacked a direct TypeScript example. This addition makes it easier for TypeScript users to understand how to integrate @fastify/compress effectively.
Checklist
- [x] Documentation was updated (README.md)
- [x] Commit message follows the Developer's Certification of Origin
- [ ] Run
npm run testandnpm run benchmark(not applicable to docs-only change) - [ ] Tests and/or benchmarks are included (not applicable)
Hi @jsumners
Thanks for the initial review!
I've now updated the PR with:
- A new
Usage Highlightssection covering advanced features like:-
inflateIfDeflated -
removeContentLengthHeader -
customTypesusing both regex and function
-
Let me know if you think it’s ready or if you'd like any further adjustments.
@Fdawgs considering your comment, and the amount of months ago that this has been opened, should we consider closing it?
@Fdawgs considering your comment, and the amount of months ago that this has been opened, should we consider closing it?
I'm happy to close it if others are.