es-toolkit/compat â
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.
â 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 lodashMigration flow â
Recommended path for removing Lodash from an existing codebase:
- Swap the import path from
lodash/lodash-estoes-toolkit/compat. Leave call sites as they are. - Clean up call sites over time and switch the import to
es-toolkit. Once done, you get a smaller bundle and faster runtime.
How it differs from es-toolkit â
- API shape: matches Lodash 1:1, including implicit type coercions, multiple argument shapes, and deprecated helpers.
es-toolkitonly exposes the type-safe, modern forms. - Bundle size and speed: slightly larger and slightly slower than
es-toolkit, because it carries extra logic to match Lodash's behavior. - Deprecated functions: kept in
compatfor parity, not ines-toolkit. Clean them up during migration.
For function-level documentation, see the Compat Reference.
Design Principles â
INFO
Design principles are subject to change.
Our compatibility layer aims to achieve feature parity with 100% accuracy for:
- Features that are written as a test case in lodash.
- Features that can be inferred from types of
@types/lodashor@types/lodash-es. - Feature differences identified while migrating code from lodash to es-toolkit (please report these to our issues page).
However, the following are out of scope for es-toolkit/compat:
- Implicit type conversions, such as converting an empty string to zero or false.
- Functions that have specialized implementations for specific types of arrays, like sortedUniq.
- Handling cases where internal object prototypes, like
Array.prototype, have been modified. - Managing cases with JavaScript realms.
- Method chaining support through "Seq" methods.
Implementation Status â
INFO
The following emojis indicate the status of each feature:
- â : Completed (The function is fully implemented and has passed all tests with lodash test code.)
- đ: In Review (The function is implemented but hasn't been tested with lodash test code yet.)
- â: Not Implemented (The function hasn't been implemented.)
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.
"Array" method
| Function Name | Implementation Status |
|---|---|
| chunk | â |
| compact | â |
| concat | â |
| difference | â |
| differenceBy | â |
| differenceWith | â |
| drop | â |
| dropRight | â |
| dropRightWhile | â |
| dropWhile | â |
| fill | â |
| findIndex | â |
| findLastIndex | â |
| flatten | â |
| flattenDeep | â |
| flattenDepth | â |
| fromPairs | â |
| head | â |
| indexOf | â |
| initial | â |
| intersection | â |
| intersectionBy | â |
| intersectionWith | â |
| join | â |
| last | â |
| lastIndexOf | â |
| nth | â |
| pull | â |
| pullAll | â |
| pullAllBy | â |
| pullAllWith | â |
| pullAt | â |
| remove | â |
| reverse | â |
| slice | â |
| sortedIndex | â |
| sortedIndexBy | â |
| sortedIndexOf | â |
| sortedLastIndex | â |
| sortedLastIndexBy | â |
| sortedLastIndexOf | â |
| sortedUniq | No support |
| sortedUniqBy | No support |
| tail | â |
| take | â |
| takeRight | â |
| takeRightWhile | â |
| takeWhile | â |
| union | â |
| unionBy | â |
| unionWith | â |
| uniq | â |
| uniqBy | â |
| uniqWith | â |
| unzip | â |
| unzipWith | â |
| without | â |
| xor | â |
| xorBy | â |
| xorWith | â |
| zip | â |
| zipObject | â |
| zipObjectDeep | â |
| zipWith | â |
"Collection" method
| Function Name | Implementation Status |
|---|---|
| countBy | â |
| every | â |
| filter | â |
| find | â |
| findLast | â |
| flatMap | â |
| flatMapDeep | â |
| flatMapDepth | â |
| forEach | â |
| forEachRight | â |
| groupBy | â |
| includes | â |
| invokeMap | â |
| keyBy | â |
| map | â |
| orderBy | â |
| partition | â |
| reduce | â |
| reduceRight | â |
| reject | â |
| sample | â |
| sampleSize | â |
| shuffle | â |
| size | â |
| some | â |
| sortBy | â |
"Date" method
| Function Name | Implementation Status |
|---|---|
| now | â |
"Function" method
| Function Name | Implementation Status |
|---|---|
| after | â |
| ary | â |
| before | â |
| bind | â |
| bindKey | â |
| curry | â |
| curryRight | â |
| debounce | â |
| defer | â |
| delay | â |
| flip | â |
| memoize | â |
| negate | â |
| once | â |
| overArgs | â |
| partial | â |
| partialRight | â |
| rearg | â |
| rest | â |
| spread | â |
| throttle | â |
| unary | â |
| wrap | â |
"Lang" method
| Function Name | Implementation Status |
|---|---|
| castArray | â |
| clone | â |
| cloneDeep | â |
| cloneDeepWith | â |
| cloneWith | â |
| conformsTo | â |
| eq | â |
| gt | â |
| gte | â |
| isArguments | â |
| isArray | â |
| isArrayBuffer | â |
| isArrayLike | â |
| isArrayLikeObject | â |
| isBoolean | â |
| isBuffer | â |
| isDate | â |
| isElement | â |
| isEmpty | â |
| isEqual | â |
| isEqualWith | â |
| isError | â |
| isFinite | â |
| isFunction | â |
| isInteger | â |
| isLength | â |
| isMap | â |
| isMatch | â |
| isMatchWith | â |
| isNaN | â |
| isNative | â |
| isNil | â |
| isNull | â |
| isNumber | â |
| isObject | â |
| isObjectLike | â |
| isPlainObject | â |
| isRegExp | â |
| isSafeInteger | â |
| isSet | â |
| isString | â |
| isSymbol | â |
| isTypedArray | â |
| isUndefined | â |
| isWeakMap | â |
| isWeakSet | â |
| lt | â |
| lte | â |
| toArray | â |
| toFinite | â |
| toInteger | â |
| toLength | â |
| toNumber | â |
| toPlainObject | â |
| toSafeInteger | â |
| toString | â |
"Math" method
| Function Name | Implementation Status |
|---|---|
| add | â |
| ceil | â |
| divide | â |
| floor | â |
| max | â |
| maxBy | â |
| mean | â |
| meanBy | â |
| min | â |
| minBy | â |
| multiply | â |
| round | â |
| subtract | â |
| sum | â |
| sumBy | â |
"Number" method
| Function Name | Implementation Status |
|---|---|
| clamp | â |
| inRange | â |
| random | â |
"Object" method
| Function Name | Implementation Status |
|---|---|
| assign | â |
| assignIn | â |
| assignInWith | â |
| assignWith | â |
| at | â |
| create | â |
| defaults | â |
| defaultsDeep | â |
| findKey | â |
| findLastKey | â |
| forIn | â |
| forInRight | â |
| forOwn | â |
| forOwnRight | â |
| functions | â |
| functionsIn | â |
| get | â |
| has | â |
| hasIn | â |
| invert | â |
| invertBy | â |
| invoke | â |
| keys | â |
| keysIn | â |
| mapKeys | â |
| mapValues | â |
| merge | â |
| mergeWith | â |
| omit | â |
| omitBy | â |
| pick | â |
| pickBy | â |
| result | â |
| set | â |
| setWith | â |
| toPairs | â |
| toPairsIn | â |
| transform | â |
| unset | â |
| update | â |
| updateWith | â |
| values | â |
| valuesIn | â |
"String" method
| Function Name | Implementation Status |
|---|---|
| camelCase | â |
| capitalize | â |
| deburr | â |
| endsWith | â |
| escape | â |
| escapeRegExp | â |
| kebabCase | â |
| lowerCase | â |
| lowerFirst | â |
| pad | â |
| padEnd | â |
| padStart | â |
| parseInt | â |
| repeat | â |
| replace | â |
| snakeCase | â |
| split | â |
| startCase | â |
| startsWith | â |
| template | â |
| toLower | â |
| toUpper | â |
| trim | â |
| trimEnd | â |
| trimStart | â |
| truncate | â |
| unescape | â |
| upperCase | â |
| upperFirst | â |
| words | â |
"Util" method
| Function Name | Implementation Status |
|---|---|
| attempt | â |
| bindAll | â |
| cond | â |
| conforms | â |
| constant | â |
| defaultTo | â |
| flow | â |
| flowRight | â |
| identity | â |
| iteratee | â |
| matches | â |
| matchesProperty | â |
| method | â |
| methodOf | â |
| mixin | No support |
| noConflict | No support |
| noop | â |
| nthArg | â |
| over | â |
| overEvery | â |
| overSome | â |
| property | â |
| propertyOf | â |
| range | â |
| rangeRight | â |
| runInContext | No support |
| stubArray | â |
| stubFalse | â |
| stubObject | â |
| stubString | â |
| stubTrue | â |
| times | â |
| toPath | â |
| uniqueId | â |

