-
-
Couldn't load subscription status.
- Fork 50
docs: improve README with updated usage examples #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's Changed
- Added complete usage examples for both compression and decompression
- Clarified per-route and global configuration
- Improved formatting and consistency
- Fixed minor typos and outdated content
- Ensured compatibility with TypeScript examples
Motivation
This update provides clearer guidance for new users and better illustrates advanced use cases like
inflateIfDeflated,removeContentLengthHeader, andcustomTypes.
I don't see any of that in this change set. All I see is the addition of a TypeScript example.
|
Hi @jsumners Thanks for the initial review! I've now updated the PR with:
Let me know if you think it’s ready or if you'd like any further adjustments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I'm -1 on this as it duplicates content already present in the readme, just under a TypeScript label.
I don't think this is worth increasing the length of the readme by ~20% for; I'd rather the readme be as lean as possible so users don't have to scroll for 10 seconds like in fastify-swagger.
We've already got types/index.d.ts and types in package.json, which clearly signals TypeScript support.
Happy to revisit if there's a way to provide meaningful TS-specific guidance without duplicating existing examples.
|
@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. |
Summary
This PR improves the
README.mdby adding a clear and minimal TypeScript usage example, aligning with the plugin's existing TypeScript support.What's Changed
reply.compressMotivation
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/compresseffectively.Checklist
npm run testandnpm run benchmark(not applicable to docs-only change)