@E18e/For Each

1.0.5Last update Aug 9, 2024
by@e18e

for-each Codemod

Introduction

This codemod replaces the usage of the for-each npm module with the built-in Array.prototype.forEach method. This helps reduce unnecessary dependencies and optimizes the performance of the codebase by leveraging native JavaScript functionality.

Before

import forEach from 'for-each';
forEach(array, (item) => {
console.log(item);
});

After

array.forEach((item) => {
console.log(item);
});

Build custom codemods

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

background illustrationGet Started Now