Lodash/2/Es Toolkit/Migrate

0.1.0Last update Mar 20, 2025
by@other-yuka

Lodash to es-toolkit

This codemod automates the migration from Lodash library to es-toolkit package.

  • Converts imports from Lodash to their equivalent es-toolkit imports
  • Changes package from lodash to es-toolkit and adjusts import statements accordingly
  • Supports various import styles:
    • Named imports (e.g. import { capitalize } from "lodash")
    • Namespace imports (e.g. import * as _ from "lodash")
    • Default imports (e.g. import _ from "lodash")
    • CommonJS require statements (e.g. const { capitalize } = require("lodash"))
    • Mixed import patterns
  • Updates lodash dependencies to es-toolkit in package.json files
  • Works with both TypeScript and JavaScript files
  • Handles import transformations in JSX/TSX files

Example

Before:

import { capitalize } from "lodash";

After:

import { capitalize } from "es-toolkit";

Build custom codemods

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

background illustrationGet Started Now