About Utilities
Standalone utility functions for Fastify applications
Browse the snippets below to find the utilities implementation you need for your Fastify project.
All Utilities Snippets
Request ID
Unique ID for request tracing
- UUID generation
- Header propagation
- Correlation context creation
Response Time
Add X-Response-Time header and metrics
- Millisecond precision
- X-Response-Time header
- Slow request logging
Compression
Response compression with @fastify/compress
- Brotli compression (preferred)
- Gzip fallback
- Threshold configuration
How to Use
Install any snippet using the Hanma CLI:
npx hanma add --framework fastify
For example, to install the first snippet:
npx hanma add fastify-request-id --framework fastify