docs/compat/intro.md
es-toolkit/compat mirrors Lodash's interface and behavior 1:1. It exists so you can lift an existing Lodash codebase into es-toolkit without rewriting call sites, and migrate to the strict API at your own pace.
If your project does not already use Lodash, please use es-toolkit instead.
::: tip ✅ 100% compatibility since v1.39.3
es-toolkit/compat passes Lodash's own test suite, so behavior is identical while staying lighter and faster.
:::
// Same call signature as lodash, but coming from es-toolkit/compat
import { chunk } from 'es-toolkit/compat';
chunk([1, 2, 3, 4], 0);
// Returns [], identical to lodash
Recommended path for removing Lodash from an existing codebase:
lodash / lodash-es to es-toolkit/compat. Leave call sites as they are.es-toolkit. Once done, you get a smaller bundle and faster runtime.es-toolkites-toolkit only exposes the type-safe, modern forms.es-toolkit, because it carries extra logic to match Lodash's behavior.compat for parity, not in es-toolkit. Clean them up during migration.For function-level documentation, see the Compat Reference.
::: info Design principles are subject to change. :::
Our compatibility layer aims to achieve feature parity with 100% accuracy for:
@types/lodash or @types/lodash-es.However, the following are out of scope for es-toolkit/compat:
Array.prototype, have been modified._(arr).map(...).filter(...).::: info The following emojis indicate the status of each feature:
Even if a feature is marked "in review," it might already be under review to ensure it matches lodash perfectly, and it could already offer the same functionality. :::
<CompatibilityStatus lang="en"/>