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.
npm install remedaVerified import paths — ran on the pinned version, not inferred.
Demonstrates `pipe` for chaining multiple functional operations (forEach, unique, take) on an array in a data-first manner.
Consult the official Remeda v2 migration guide for specific function changes. For example, `map.indexed(DATA, ...)` becomes `map(DATA, (item, index) => ...)`.
Update function calls to use the new names as specified in the v2 migration guide. For instance, replace `uniq` with `unique`.
Ensure single-parameter functions are invoked with `()` if intended for data-last application (e.g., `pipe(data, keys())` instead of `pipe(data, keys)`). Type guards (e.g., `isString`) are exceptions and remain 'headless'.
Carefully review TypeScript errors. Adjust your data types or use type assertions (`as Type`) if you are confident in the data's structure. Consider enabling stricter TypeScript flags incrementally.
Consult the official migration guides for Lodash and Ramda on remedajs.com for detailed function-by-function comparison and migration steps. Expect to refactor code rather than simply renaming functions.
Replace `mapToObj` with `pullObject` or a composition of `fromEntries(map(array, fn))` to achieve similar results, which are generally more performant and idiomatic.
Ensure your data types and function signatures align with Remeda's strict typings. You may need to refine your own type definitions, or use type assertions if you are certain of the type.
Confirm you are using `import { someFunction } from 'remeda';` for named exports in an ESM context. Check your `tsconfig.json` and `package.json` for correct module resolution settings if using TypeScript or Node.js ESM.Consider narrowing the type before using `prop`, or explicitly type the object being accessed if the type inference is failing. For known issues, check Remeda's GitHub issues for workarounds or future fixes. You might need to use `as any` as a last resort, but this reduces type safety.
No dependency data recorded yet.