gitmyhub

es-toolkit

TypeScript ★ 11k updated 5h ago

A modern JavaScript utility library that's 2-3 times faster and up to 97% smaller—a major upgrade to lodash.

es-toolkit is a modern JavaScript utility library offering functions like debounce, chunk, and pick that can shrink your app's bundle by up to 97% vs lodash, with a drop-in compatibility layer.

TypeScriptJavaScriptsetup: easycomplexity 2/5

es-toolkit is a JavaScript utility library, which means it is a collection of small, pre-written functions that developers commonly need when building web applications. Functions like debounce (which delays an action until a user stops typing), chunk (which splits a list into smaller groups), and pick (which pulls specific fields from an object) are included. Instead of writing these from scratch each time, a developer installs the library and uses the pre-built versions.

The main appeal compared to older libraries like lodash is a much smaller file footprint. Because es-toolkit is designed to support tree shaking, only the specific functions your application uses get included in the final JavaScript file sent to users' browsers. According to the project's benchmarks, this can reduce bundle size by up to 97% compared to similar libraries. The library also claims to run 2 to 3 times faster in modern JavaScript environments.

For teams already using lodash, es-toolkit ships a compatibility layer called es-toolkit/compat that makes it a near drop-in replacement. You can swap it in without rewriting all existing code.

The library is written in TypeScript, meaning editors like VS Code will show type hints and catch certain errors before you run the code. It also provides utility functions for checking the type of a value, such as testing whether something is neither null nor undefined.

es-toolkit is used in several well-known open-source projects, including Storybook, Recharts, and CKEditor. It was built by Toss, a South Korean fintech company, and is released under the MIT license.

Where it fits