Fastify/5/GetResponseTime To ElapsedTime

/icons/calendar.svg

Last update

Dec 17, 2024

This codemod converts reply.getResponseTime() to reply.elapsedTime, reflecting changes in Fastify v5 for retrieving response time.

Before

fastify.get('/route', (req, reply) => {
console.log(reply.getResponseTime());
return { hello: 'world' };
});

After

fastify.get('/route', (req, reply) => {
console.log(reply.elapsedTime);
return { hello: 'world' };
});

Build custom codemods

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

background illustrationGet Started Now