Remeda
A TypeScript-first utility library with data-first and data-last function variants, lazy pipe evaluation, and fully typed transformations.
Repository Health
Technical Analysis
Remeda is a general-purpose utility library for JavaScript and TypeScript that positions itself as the “data-first and data-last” alternative to Lodash and Ramda. Every one of its 150+ functions for arrays, objects, strings, and numbers can be called either as fn(data, ...args) for one-off use or curried as fn(...args)(data) for point-free composition inside pipe, dispatched through a shared internal helper rather than duplicated overload sets. Consecutive lazy-tagged functions (map, filter, take, drop, forEach, unique) fuse into a single iteration pass inside pipe, allowing early termination on large collections without a separate transducer API.
The package has zero runtime dependencies and ships from a monorepo that also builds an Astro-based documentation site with dedicated Lodash and Ramda migration guides. It is built with tsdown, validated on every release with arethetypeswrong and publint, and published to both npm and JSR as dual ESM/CJS artifacts. Every exported function has a matching runtime test, most have a dedicated TypeScript type-test exercised through Vitest’s typecheck project, and select functions carry property-based tests via @fast-check/vitest — combined with a CI matrix that runs against multiple TypeScript versions and Codecov/CodeQL/OpenSSF Scorecard checks.
What You Get
- 150+ tree-shakable utility functions for arrays, objects, strings, and numbers, importable individually or via the barrel export
- Data-first and data-last call signatures for every function, so you can choose ergonomic one-off calls or point-free pipe composition
- Built-in lazy evaluation through
pipe/pipedthat fuses consecutive map/filter/take-style calls into a single pass over the data - First-class TypeScript types with per-function overloads, published in a single bundled declaration file for editor performance
- Dual ESM/CJS builds plus a JSR publish target, validated with
arethetypeswrongandpublinton every release
Common Use Cases
- Migrating a Lodash or Ramda codebase to a fully-typed, tree-shakable alternative without giving up familiar function names
- Building a data transformation pipeline (parse -> filter -> group -> aggregate) with
pipe, where early termination viatake/findmatters for performance - Replacing ad-hoc array/object helper functions scattered across a codebase with a single, extensively-tested utility surface
- Working with immutable, readonly-typed data structures where TypeScript needs to track literal and const-asserted types through transformations
- Writing point-free functional-style TypeScript without needing a separate FP library like fp-ts
Under The Hood
Architecture
Remeda’s public surface is a barrel file (src/index.ts) re-exporting roughly 150 independently testable function modules (src/*.ts). Each function typically exposes overloaded data-first/data-last signatures dispatched at runtime through internal helpers (src/internal/purryFromLazy.ts, src/internal/purryOn.ts) that inspect argument count and curry state rather than hand-duplicating implementations. Lazy-evaluable functions (map, filter, take, drop, forEach, unique, etc.) implement a shared LazyEvaluator contract (src/internal/types/LazyEvaluator.ts) consumed by pipe/piped (src/pipe.ts, src/piped.ts), which walks the composed function list and only materializes intermediate arrays when consecutive steps aren’t all lazy-tagged, enabling early termination without a runtime dependency graph. Lower-level internal helpers (quick-select, binary search, a heap implementation) live under src/internal/ and are composed into public functions rather than exposed directly. Changing the LazyEvaluator/LazyResult contract would ripple through every lazy-tagged function and the pipe dispatcher itself.
Tech Stack
The package is pure TypeScript with zero runtime dependencies. It builds via tsdown (a Rolldown-based bundler) using a two-phase config: a first pass emits a single bundled .d.ts with manual type-polyfill injection for older TypeScript versions, followed by a second pass that emits per-function minified ESM and CJS artifacts globbed from src/*.ts, so consumers can import either the barrel or individual functions directly. The build output is validated with arethetypeswrong and publint. Tests run under Vitest 4 across three named projects — runtime, types (via Vitest’s typecheck integration), and property-based tests. The surrounding monorepo is managed with npm workspaces and also contains an Astro-based documentation site, a StackBlitz template package, and a brand-assets package; releases are cut with semantic-release and published to both npm and JSR.
Code Quality
Every exported function has a matching runtime test file, and most also have a dedicated type-test file exercising the function’s TypeScript overloads through Vitest’s typecheck project; a subset of functions additionally carry property-based tests written with @fast-check/vitest. Coverage is tracked through Codecov. The ESLint configuration layers eslint-plugin-unicorn, eslint-plugin-jsdoc, and typescript-eslint with zero tolerance for warnings, and sampled source files show consistent, justified inline lint-suppression comments rather than blanket disables. CI runs a matrix of TypeScript versions (latest and beta) for both source and built-artifact tests, plus a separate typecheck job, CodeQL scanning, and an OpenSSF Scorecard workflow.
API Design
The defining design decision is that every function supports both a data-first call (filter(array, fn)) and a data-last call (filter(fn)(array)) from one shared implementation, letting data-last usage compose point-free inside pipe while data-first usage stays ergonomic for one-off calls. Lazy evaluation is integrated directly into pipe rather than exposed as a separate transducer API, giving Lodash-familiar function names with Ramda-like composability and stronger type inference than Ramda’s typings have historically offered. Extensive JSDoc on every function — including @dataFirst/@dataLast tags, worked @example blocks, and a @signature line — gives strong in-editor documentation with minimal boilerplate required to get started.
Used by 8 apps in this directory
Bigcapital
Invoicing Finance
Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.
Dittofeed
Marketing · Automation
Open-source omni-channel customer engagement platform for automating transactional and marketing messages via email, SMS, WhatsApp, Slack, and mobile push.
Documenso
Digital Signiture
Self-hosted, open-source DocuSign alternative with legally binding PDF signatures, multi-party workflows, and a full REST and tRPC API.
likec4
Developer Tools · Devops
Define your software architecture as code and get always up-to-date, interactive C4 diagrams generated automatically from a DSL.
open-seo
Marketing · Developer Tools
Pay-as-you-go open source SEO platform with MCP integration — keyword research, rank tracking, backlinks, site audits, and AI brand visibility in one self-hosted tool.
OpenCode
AI Code Assistants
A fully open-source AI coding agent built for the terminal, with a TUI, desktop app, web client, plugin system, and SDK — one of the most-starred AI coding agents on GitHub.
Openship
Devops · Hosting Control Panel
Openship is an open-source, self-hostable deployment platform that points at a repo and builds, ships, routes, and TLS-terminates the app — driven from a desktop app, web dashboard, or CLI.
Plasmic
CMS · Low Code Platforms · No Code Platforms
The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.