toss

es-toolkit: How an Internal Little Library Became a Global Library (opens in new tab)

es-toolkit began as Toss’s effort to create a modern alternative to lodash, removing legacy code and optimizing for current JavaScript environments. By focusing on common use cases, it achieved 2–10× faster performance and reductions in bundle size of more than 30×. Community adoption, compatibility tooling, and contributions to major projects eventually pushed it beyond 20 million weekly npm downloads.

Why es-toolkit Was Created

  • Developers frequently needed utilities such as throttle, debounce, and uniq, but existing options had drawbacks.
  • lodash contained legacy implementations, Internet Explorer workarounds, and limited ECMAScript Modules support.
  • Even lodash-es mainly added ESM support without modernizing the underlying code.
  • Toss had maintained its own @toss/utils, but handling utility-function edge cases internally was burdensome.
  • es-toolkit’s goal was to remove unnecessary logic, improve performance, and produce smaller bundles for modern web applications.

Performance and Bundle-Size Improvements

  • Reimplementing core lodash-style functions produced:
    • At least 2× faster execution for some functions.
    • More than 10× faster execution for others.
  • Using modern built-ins such as Array#map eliminated compatibility code.
  • Bundle sizes were reduced by more than 30× in some cases.
  • The project was designed around the most common use cases rather than every historical edge case supported by lodash.

Growth Through the Open-Source Community

  • The first release was shared through Toss’s frontend social channels and quickly attracted users and contributors.
  • Contributors added missing functions, fixed bugs, and optimized implementations.
  • After promotion on international developer communities, the project received more than 100 recommendations and tens of thousands of repository visitors.
  • Blogs and newsletters helped extend its reach.
  • Community members created migration plugins and independently replaced lodash dependencies in other libraries.

From Contributor to Maintainer

  • Toss Bank developer Dayong first joined as an external contributor, submitting small pull requests.
  • Reviewing and designing interfaces for es-toolkit provided valuable experience with JavaScript and API design.
  • Continued contributions eventually made her the project’s second-largest contributor and helped lead to her joining Toss Bank.
  • The project also demonstrated how an open-source initiative can connect contributors across companies and countries.

Lowering the Migration Barrier with es-toolkit/compat

  • Adoption was initially slow because applications often imported many lodash functions throughout their codebases.
  • Replacing every import manually would make migration expensive and risky.
  • es-toolkit’s standard implementations also differed from lodash in some edge cases.
  • es-toolkit/compat was introduced as a drop-in replacement:
    • It preserves lodash-compatible interfaces and behavior as much as possible.
    • It modernizes the internal implementations.
    • Projects can gain performance and bundle-size benefits with minimal code changes.
  • This helped major projects such as Storybook, Mermaid, Yarn Berry, and Recharts adopt es-toolkit.

Future Direction

  • es-toolkit plans to help more JavaScript libraries reduce their bundle sizes and improve efficiency.
  • It aims to add modern utilities, including:
    • filter-style functions for Map and Set.
    • Promise-based helpers such as delay.
    • Server-oriented utilities for Node.js, Deno, and Bun.
  • New functions such as exec are intended to provide essential functionality with smaller implementations than competing libraries.
  • The project plans to maintain its core principle: optimize for more than 80% of common use cases while remaining small, fast, and high quality.

es-toolkit’s success shows that a focused, modern implementation can replace widely used legacy utilities when it combines measurable technical benefits with strong migration support and active community participation.