es-toolkit vs lodash: Up to 97% Smaller Bundle and 2‑3× Faster Performance

es-toolkit is a modern JavaScript utility library that offers a tiny bundle—up to 97% smaller than lodash—built‑in TypeScript support, 100‑byte functions, and runtime performance that is 2‑3 times faster, with detailed size and speed benchmarks and installation guides for Node, Deno, and Bun.

Full-Stack Cultivation Path
Full-Stack Cultivation Path
Full-Stack Cultivation Path
es-toolkit vs lodash: Up to 97% Smaller Bundle and 2‑3× Faster Performance

Introduction

es-toolkit is a modern JavaScript utility library that emphasizes small bundle size and high performance, providing strong TypeScript typings.

Tool URL: https://es-toolkit.slash.page/ Repository: https://github.com/toss/es-toolkit

Highlights and Features

Provides everyday utility functions such as debounce, delay, chunk, sum, and pick.

Designed for performance; runtime speed is 2‑3× faster than comparable libraries in modern JavaScript environments.

Reduces JavaScript code size by up to 97% compared with alternatives.

Built‑in TypeScript support with powerful type guards like isNotNil.

Achieves 100% test coverage to ensure reliability.

Core Functions

Array utilities: uniq, difference.

Function utilities: debounce, throttle.

Math utilities: sum, round.

Object utilities: pick, omit.

Predicate utilities: type‑guard functions such as isNotNil.

Promise utilities: delay.

String utilities: snakeCase.

Installation

es-toolkit can be installed via several package managers:

Node.js (>=18): npm install es-toolkit Deno (via JSR, package name differs): deno add @es-toolkit/es-toolkit Bun:

bun add es-toolkit

Usage Example

// import from 'es-toolkit'
import { debounce, chunk } from "es-toolkit";

const debouncedLog = debounce(message => {
  console.log(message);
}, 300);

debouncedLog("Hello, world!");

const array = [1, 2, 3, 4, 5, 6];
const chunkedArray = chunk(array, 2);
console.log(chunkedArray); // [[1,2],[3,4],[5,6]]

Bundle Size

Compared with lodash and similar libraries, es-toolkit reduces bundle size by roughly 97%; some functions are under 100 bytes. Detailed size comparison is shown in the figure below.

Bundle size comparison
Bundle size comparison

Performance

Benchmarks on a MacBook Pro 14‑inch (M1 Max, 2021) show that es-toolkit’s average performance is about twice that of lodash, with some functions achieving up to an 11‑fold speedup.

Performance benchmark
Performance benchmark
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

performanceTypeScriptJavaScriptbundle sizelodashutility libraryes-toolkit
Full-Stack Cultivation Path
Written by

Full-Stack Cultivation Path

Focused on sharing practical tech content about TypeScript, Vue 3, front-end architecture, and source code analysis.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.