lodash

A modern utility library delivering modularity, performance, and extras for working with arrays, objects, and functions.

lodash

General JS

A modern utility library delivering modularity, performance, and extras for working with arrays, objects, and functions.

Fit

Bundle (gzip)

25.3 kB

70.2 kB raw

Install size includes transitive dependencies. Bundle size is gzipped browser payload.

Freshness

The Problem

Everyday data wrangling — deep cloning, grouping, debouncing, deep property access, and set operations — is verbose and error-prone with plain JavaScript, and hand-rolled helpers tend to drift and break on edge cases like null or nested values.

What It Does

lodash provides hundreds of battle-tested, consistent utilities for collections, objects, strings, and functions. It handles edge cases predictably, supports per-method imports to keep bundles small, and is one of the most depended-upon packages in the npm ecosystem.

Installation

bash
npm install lodash

Usage Example

js
import { groupBy, debounce, get } from "lodash";

const users = [
  { name: "Ada", team: "core" },
  { name: "Lin", team: "core" },
  { name: "Max", team: "ops" },
];

console.log(groupBy(users, "team"));
// { core: [...], ops: [...] }

console.log(get(users, "[0].name")); // "Ada"

const onSearch = debounce((q) => console.log("search:", q), 200);
onSearch("lo");

Related packages