lodash
Lodash is the most popular JavaScript utility library, providing a comprehensive collection of functions for manipulating arrays, objects, strings, numbers, and…
Installation
npm install lodash
yarn add lodash
pnpm add lodash
Import
import _ from 'lodash';
Quick Example
import { debounce, groupBy, get } from 'lodash';
const debouncedSearch = debounce(search, 300);
const grouped = groupBy(users, 'role');
const name = get(user, 'profile.name', 'Unknown');About lodash
Lodash is the most popular JavaScript utility library, providing a comprehensive collection of functions for manipulating arrays, objects, strings, numbers, and functions. Created as a fork of Underscore.js with better performance and consistency, Lodash has become the de facto standard for utility functions in JavaScript projects. The library provides deep cloning (cloneDeep), deep merging, object path access (get/set), collection operations (groupBy, keyBy, sortBy, uniq), function utilities (debounce, throttle, memoize, once, curry), string manipulation (camelCase, kebabCase, capitalize, truncate), and type checking functions. Lodash is highly modular — you can import individual functions (lodash/debounce) or use lodash-es for tree-shakeable ES module imports. The library handles edge cases and cross-browser inconsistencies that native JavaScript methods may not, providing reliable behavior across environments. While modern JavaScript has adopted many utility functions natively (Array.flat, Object.entries, Array.find), Lodash's deep operations, functional programming utilities, and collection processing functions remain valuable for complex data transformation tasks in production applications.
Quick Facts
| Package | lodash |
| Category | Utility |
| Weekly Downloads | 50M+ |
| License | MIT |
| Install | npm install lodash |
Related Packages
Underscore is a JavaScript utility library that provides functional programming helpers for working …
Ramda is a functional programming library for JavaScript that emphasizes immutability, pure function…
date-fns is a modern JavaScript date utility library that provides comprehensive, consistent, and mo…
uuid is the standard library for generating RFC 4122 compliant Universally Unique Identifiers (UUIDs…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.