Skip to main content
This release is 3 versions behind 1.31.0 — the latest version of @es-toolkit/es-toolkit. Jump to latest

@es-toolkit/es-toolkit@1.29.0-dev.958+1d1d0ee6
Built and signed on GitHub Actions

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

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a month ago (1.29.0-dev.958+1d1d0ee6)

es-toolkit

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 state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

  • es-toolkit offers a variety of everyday utility functions with modern implementations, such as debounce, delay, chunk, sum, and pick.
  • Designed with performance in mind, es-toolkit achieves 2-3× better performance in modern JavaScript environments.
  • es-toolkit supports tree shaking out of the box, and reduces JavaScript code by up to 97% compared to other libraries.
  • es-toolkit includes built-in TypeScript support, with straightforward yet robust types. It also provides useful type guards such as isNotNil.
  • es-toolkit is battle-tested with 100% test coverage, ensuring reliability and robustness.

Features

Here are some of the features es-toolkit offers:

  • Array: Utilities for array manipulation, such as uniq and difference.
  • Function: Tools for controlling function execution, including debounce and throttle.
  • Math: Numerical utilities like sum and round.
  • Object: Tools for manipulating JavaScript objects, such as pick and omit.
  • Predicate: Type guard functions like isNotNil.
  • Promise: Asynchronous utilities like delay.
  • String: Utilities for string manipulation, such as snakeCase

Examples

// import from '@es-toolkit/es-toolkit' in jsr.
import { debounce, chunk } from 'es-toolkit';

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

// This call will be debounced
debouncedLog('Hello, world!');

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

console.log(chunkedArray);
// Output: [[1, 2], [3, 4], [5, 6]]

Resources

If you want to know more about the project, please take a look at the following resources:

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@es-toolkit/es-toolkit

Import symbol

import * as es_toolkit from "@es-toolkit/es-toolkit";

---- OR ----

Import directly with a jsr specifier

import * as es_toolkit from "jsr:@es-toolkit/es-toolkit";

Add Package

npx jsr add @es-toolkit/es-toolkit

Import symbol

import * as es_toolkit from "@es-toolkit/es-toolkit";

Add Package

yarn dlx jsr add @es-toolkit/es-toolkit

Import symbol

import * as es_toolkit from "@es-toolkit/es-toolkit";

Add Package

pnpm dlx jsr add @es-toolkit/es-toolkit

Import symbol

import * as es_toolkit from "@es-toolkit/es-toolkit";

Add Package

bunx jsr add @es-toolkit/es-toolkit

Import symbol

import * as es_toolkit from "@es-toolkit/es-toolkit";