@E18e/Left Pad

1.0.5Last update Aug 9, 2024
by@e18e

Left Pad Codemod

Introduction

This codemod removes the left-pad dependency from the codebase and replaces its usage with the built-in String.prototype.padStart method. This change helps reduce unnecessary dependencies and bundle size while leveraging native JavaScript features for improved performance.

Before

import leftPad from 'left-pad';
const paddedString = leftPad('text', 10);

After

const paddedString = 'text'.padStart(10);

Build custom codemods

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

background illustrationGet Started Now