Registry
M

fastify/5/make-reply-trailer-async

No description available

manishjha-04175 executions

  • Legacy
  • fastify
  • 5
  • migration
Connect a repo
npx codemod fastify/5/make-reply-trailer-async

This codemod updates the reply.trailer method to use an async function for handling trailers, aligning with Fastify v5's support for asynchronous operations in trailers.

Before

ts
fastify.get('/route', (req, reply) => {
  reply.trailer('ETag', function(reply, payload) {
    return 'custom-etag';
  });
  reply.send('');
});

After

ts
fastify.get('/route', (req, reply) => {
  reply.trailer('ETag', async function(reply, payload) {
    return 'custom-etag';
  });
  reply.send('');
});

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.