es-toolkit
A modern JavaScript utility library that's 2-3x faster and up to 97% smaller than Lodash.
Repository Health
Technical Analysis
es-toolkit is a state-of-the-art JavaScript utility library built as a modern, high-performance alternative to Lodash. It ships hundreds of tree-shakable functions across arrays, objects, strings, promises, math, and more, each written in modern TypeScript with strict types and extensive JSDoc examples.
Beyond the core API, es-toolkit/compat provides a drop-in compatibility layer that mirrors Lodash’s exact behavior for teams migrating incrementally, while the core package stays lean, side-effect free, and optimized for bundlers. The project maintains extensive test coverage, cross-browser compatibility testing, and continuous benchmarking against Lodash to track its performance advantage.
What You Get
- Hundreds of tree-shakable utility functions across array, object, string, function, promise, math, and predicate modules
- A drop-in
es-toolkit/compatlayer that mirrors Lodash’s exact API and edge-case behavior - First-class TypeScript types and type-guard predicates (e.g. isNotNil) with no separate @types package needed
- Verified performance improvements and a dramatically smaller bundle size versus Lodash, tracked by continuous benchmarks
- Curried, data-last functional variants via the
es-toolkit/fpentry point for composition-style pipelines
Common Use Cases
- Replacing Lodash in a project to cut bundle size without rewriting call sites (via es-toolkit/compat)
- Debouncing/throttling UI event handlers with
debounce,throttle, and related function utilities - Array and object transformation pipelines (chunking, grouping, deep cloning, deep comparison) in data-processing code
- Building typed utility layers in TypeScript applications that need strict null-safety and predicate helpers
Under The Hood
Architecture
The project is organized as a flat, modular collection of single-purpose functions grouped by domain (src/array, src/object, src/string, src/function, src/predicate, src/math, src/promise, src/map, src/set, src/iterator, src/bigint, src/error, src/util, src/types), each exported from a domain index.ts and re-exported from the root src/index.ts; the library has zero runtime dependencies, so the core discipline is a strict one-function-per-file convention (each implementation file sits beside its own spec file) that keeps tree-shaking trivial. A parallel src/compat tree, with its own internal helpers for exact Lodash string-manipulation and object-merging parity, re-implements the same domains with Lodash’s precise, sometimes idiosyncratic edge-case semantics, wired together via an Object.assign onto a callable placeholder to reproduce Lodash’s mixin-style default export. A third tree, src/fp, builds curried/data-last variants on top of the core functions and adds its own lazy-evaluation engine implementing a generator-free “push” pipeline so chains of map/filter/take/flatMap fuse into a single loop instead of allocating per-stage iterators. This three-tier split (core / compat / fp) is the central architectural decision, and changing a core function’s signature ripples into both the compat shims and the fp wrappers.
Tech Stack
es-toolkit is written entirely in TypeScript with zero runtime dependencies. It is built into dual ESM/CJS outputs plus a global browser bundle used by CDN distribution, and typed via hand-authored declaration files reachable through many fine-grained package.json subpath exports for the array, compat, fp, and platform-specific util entry points. The workspace is a Yarn Berry monorepo with docs, benchmarks, and dedicated type-testing and browser-compatibility-testing workspaces as siblings. Documentation is a dedicated static-site generator instance with per-function reference pages. Testing runs on a modern test runner with a coverage provider; type-level testing runs through a separate workspace layered on top of a package-export soundness checker, and a browser-compat harness exercises real browser engines via its own CI workflow.
Code Quality
Every exported function has a co-located spec file exercised under the project’s test runner with coverage instrumentation enabled and configured for extensive coverage, and property-based testing is present as a development dependency. Error handling is explicit and typed — functions throw plain, descriptively-messaged errors for invalid input rather than silently coercing it, and a dedicated error module centralizes custom error types. Naming stays consistently camelCase, matching Lodash conventions where the compat layer requires exact parity. Type safety is strict, backed by a dedicated typecheck script and a large lint configuration that layers compatibility-target linting, ECMAScript-version restriction rules, and a custom rule discouraging certain array-iteration patterns for performance reasons. Continuous integration runs linting, type-checking, tests, static security analysis, and an open-source security posture check as separate gates.
API Design The public API mirrors familiar Lodash-style free functions, so migrating existing code requires minimal relearning, and every function ships a documentation block with parameter, return, and throw annotations plus runnable examples that also power the reference site — so developer-facing documentation lives directly next to the implementation rather than drifting out of sync. Getting started requires zero configuration, with no polyfills needed, and the compat entry point removes even the burden of renaming call sites when migrating from Lodash. The fp entry point offers curried, data-last equivalents for teams that prefer functional composition without needing a separate library.
Used by 19 apps in this directory
Novu
Developer Tools
Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.
Obot
AI Agents · Mcp
An open-source MCP platform for organizations — host MCP servers, run MCP registries, monitor usage, and build agents and chatbots on top of the Model Context Protocol from one self-hosted deployment.
open-pencil
AI Design Tools · Design Tools
An open-source design editor that reads native Figma files, ships a built-in AI assistant with 100+ design tools, and offers real-time serverless collaboration — all without giving up your files.
Outline
Collaboration · Knowledge Management
A fast, real-time collaborative knowledge base for growing teams built on React, Node.js, and ProseMirror.
Rallly
Scheduling
Self-hostable group scheduling polls that eliminate back-and-forth emails and find the best meeting time for everyone.
Rivet
AI Agents · Developer Tools
Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.
Sanity
CMS
Open-source headless CMS with a fully customizable React Studio, real-time collaborative editing, structured content modeling, and GROQ query language
Sink
Analytics · Bookmarks Archiving
Serverless link shortener with real-time analytics, powered by Cloudflare
TinaCMS
CMS
An open-source, Git-backed headless CMS that gives editors a live visual editing UI over Markdown, MDX, JSON, and YAML content while developers keep everything in version control.