es-toolkit

A modern JavaScript utility library that's 2-3x faster and up to 97% smaller than Lodash.

Library
npm
v1.52.0
11,378 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
89 /100 Excellent
Development Activity 100
Maintenance 100
Community 68
Maturity 48
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
91 /100 Excellent
Architecture 84
Code Quality 93
Innovation 88
Learning Curve 100

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/compat layer 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/fp entry 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

TypeScript
98%
Other

Novu

Developer Tools

40,195

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.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 6 days ago
Go
63%
MIT

Obot

AI Agents · Mcp

1,120

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.

View details
88
Repo Health
70
Technical
70
Dependency
Built with
Go 63%
Svelte 21%
TypeScript 15%
Updated 1 weeks ago
TypeScript
90%
MIT

open-pencil

AI Design Tools · Design Tools

9,227

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.

View details
84
Repo Health
78
Technical
69
Dependency
Built with
TypeScript 90%
Updated 1 weeks ago
TypeScript
98%
Other

Outline

Collaboration · Knowledge Management

41,045

A fast, real-time collaborative knowledge base for growing teams built on React, Node.js, and ProseMirror.

View details
91
Repo Health
87
Technical
68
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
95%
AGPL 3.0

Rallly

Scheduling

5,318

Self-hostable group scheduling polls that eliminate back-and-forth emails and find the best meeting time for everyone.

View details
91
Repo Health
75
Technical
66
Dependency
Built with
TypeScript 95%
Updated 1 weeks ago
Rust
72%
Apache 2.0

Rivet

AI Agents · Developer Tools

6,326

Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.

View details
87
Repo Health
81
Technical
64
Dependency
Built with
Rust 72%
TypeScript 25%
Updated 6 days ago
TypeScript
99%
MIT

Sanity

CMS

6,370

Open-source headless CMS with a fully customizable React Studio, real-time collaborative editing, structured content modeling, and GROQ query language

View details
92
Repo Health
90
Technical
66
Dependency
Built with
TypeScript 99%
Updated 6 days ago
TypeScript
51%
AGPL 3.0

Sink

Analytics · Bookmarks Archiving

7,231

Serverless link shortener with real-time analytics, powered by Cloudflare

View details
84
Repo Health
80
Technical
0
Dependency
Built with
TypeScript 51%
Vue 47%
Updated 1 months ago
TypeScript
98%
Apache 2.0

TinaCMS

CMS

13,845

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.

View details
92
Repo Health
74
Technical
59
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers