Remeda Utility Library

2.33.7 · active · verified Sun Apr 19

Remeda is a modern, tree-shakable utility library for JavaScript and TypeScript, focusing on a functional programming paradigm with both "data-first" and "data-last" execution styles. It is currently at version 2.33.7 and receives frequent updates, often multiple bug-fix releases per month, with minor feature releases occurring periodically. Key differentiators include its robust, first-class TypeScript support, providing highly specific and accurate types for its extensive collection of utilities. Unlike older libraries, Remeda is designed from the ground up to support lazy evaluation through `pipe` and `piped`, offers full CJS and ESM compatibility, and ensures full code coverage with comprehensive runtime and type tests. It aims to provide a reliable and type-safe alternative to libraries like Lodash and Ramda, offering migration guides for users transitioning from those ecosystems.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates `pipe` for chaining multiple functional operations (forEach, unique, take) on an array in a data-first manner.

import { pipe, forEach, unique, take } from 'remeda';

const numbers = [1, 2, 2, 3, 3, 4, 5, 6];

const processedNumbers = pipe(
  numbers,
  forEach((value) => console.log(`Processing: ${value}`)), // Side effect
  unique(), // Removes duplicates
  take(3) // Takes the first 3 elements after uniqueness
);

console.log('Result:', processedNumbers);
// Expected console output:
// Processing: 1
// Processing: 2
// Processing: 2
// Processing: 3
// Processing: 3
// Processing: 4
// Processing: 5
// Processing: 6
// Result: [1, 2, 3]

view raw JSON →