Fastify/5/Replace Reply Sent With Hijack

1.0.0Last update Sep 17, 2024
by@manishjha-04

This codemod turns reply.sent = true into reply.hijack(), updating to the new Fastify v5 method for handling manual responses.

Before

fastify.get('/route', (req, reply) => {
reply.sent = true;
reply.raw.end('hello');
});

After

fastify.get('/route', (req, reply) => {
reply.hijack();
reply.raw.end('hello');
});

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now