@E18e/Date

1.0.5Last update Aug 9, 2024
by@e18e

Date Codemod

Introduction

This codemod replaces the usage of the date and date/auto npm modules with the built-in JavaScript Date object. This transition helps reduce unnecessary dependencies, thereby decreasing the bundle size and improving the performance of the codebase.

Before

import date from 'date';
import 'date/auto';
const today = date();
const formattedDate = date.format(today, 'YYYY-MM-DD');

After

const today = new Date();
const formattedDate = today.toISOString().split('T')[0];

Build custom codemods

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

background illustrationGet Started Now