fastify-compress icon indicating copy to clipboard operation
fastify-compress copied to clipboard

docs: improve README with updated usage examples

Open williamfds opened this issue 7 months ago • 1 comments

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 test and npm run benchmark (not applicable to docs-only change)
  • [ ] Tests and/or benchmarks are included (not applicable)

williamfds avatar May 29 '25 01:05 williamfds

Hi @jsumners

Thanks for the initial review!

I've now updated the PR with:

  • A new Usage Highlights section covering advanced features like:
    • inflateIfDeflated
    • removeContentLengthHeader
    • customTypes using both regex and function

Let me know if you think it’s ready or if you'd like any further adjustments.

williamfds avatar May 29 '25 11:05 williamfds

@Fdawgs considering your comment, and the amount of months ago that this has been opened, should we consider closing it?

ilteoood avatar Oct 24 '25 14:10 ilteoood

@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.

Fdawgs avatar Oct 25 '25 06:10 Fdawgs