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
Actual
Invoicing Finance
Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.
BrowserOS
Browser · AI Assistants
The open-source agentic Chromium browser with native AI agents, MCP server, and visual workflow automation — your data never leaves your machine.
Cherry Studio
AI Assistants
All-in-one AI desktop client with 300+ assistants and multi-model support
Dify
No Code Platforms · AI Development · Developer Tools
Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.
FastGPT
AI Agents · AI Development
Build, debug, and deploy knowledge-based AI agents with a visual workflow editor, RAG retrieval, and support for any OpenAI-compatible LLM.
Fern
Developer Tools
Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.
Label Studio
AI Development · Data Engineering
Label Studio is an open-source, multi-type data labeling platform that lets teams annotate images, text, audio, video, and time series data with a configurable XML-based UI and export annotations in formats ready for any ML framework.
LobeHub
AI Assistants · Productivity · Automation
Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.
Manage
Project Management · Collaboration
Self-hosted, open-source project management with tasks, calendars, docs, and real-time team collaboration.