ramda

A practical functional programming library for JavaScript with automatic currying and immutable, side-effect-free functions.

Library
npm
v0.32.0
24,054stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
64/100Good
Development Activity44
Maintenance36
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture82
Code Quality80
Innovation70
Learning Curve80

Ramda is a functional programming library for JavaScript that treats immutability and side-effect-free functions as first-class design goals rather than opt-in patterns. Every one of its 270+ functions is automatically curried and takes its data argument last, which makes point-free composition with R.compose and R.pipe the natural way to write transformations instead of an advanced technique bolted on afterward.

Unlike general-purpose utility belts, Ramda is built specifically for a functional style: arrays and plain objects are the only data structures, functions never mutate their inputs, and the library ships Fantasy Land-compatible implementations of map, chain, ap, and traverse so it composes cleanly with other typed FP libraries like Sanctuary. It has shipped as a stable, dependency-free package since 2013 and remains one of the most widely used functional toolkits in the JavaScript ecosystem.

What You Get

  • 270+ automatically curried functions covering list processing, object manipulation, function composition, and logic, all with the data argument placed last for easy partial application.
  • Point-free composition primitives (compose, pipe, converge, useWith) for building pipelines out of small named transformations instead of imperative loops.
  • Immutable, non-mutating operations on plain arrays and objects — no custom data structures to learn, and originals are never modified.
  • Fantasy Land-compatible functors and monads (map, chain, ap, traverse) so Ramda values interoperate with libraries like Sanctuary.
  • Placeholder (R.__) support for partial application of any argument position, not just a fixed prefix.
  • ES modules, CommonJS, and pre-built UMD/minified bundles (with tree-shaking support via Rollup) so it fits Node, bundlers, or a plain <script> tag.

Common Use Cases

  • Data transformation pipelines - engineers building ETL-style transformations over JSON payloads chain small Ramda functions with pipe/compose instead of writing custom reduce loops.
  • Redux reducers and selectors - teams use assoc, dissoc, evolve, and lensPath to update state immutably without spreading nested objects by hand.
  • Point-free utility authoring - library authors compose new reusable functions from Ramda primitives (curry, compose, converge) without naming intermediate arguments.
  • Form and API-response validation - developers use path, propEq, and where to safely query and validate deeply nested objects before acting on them.

Under The Hood

Architecture Ramda’s source is organized as one function per file under source/ (274 files), each a small pure function that imports only the internal helpers it needs (source/internal/_curryN.js, _arity.js, _isPlaceholder.js), and source/index.js is a flat barrel that re-exports every function by name — there is no class hierarchy or central dispatcher; composition happens entirely through function composition at the call site (compose.js/pipe.js wrap reverse.js). Nearly every public function is wrapped in one of the internal curry helpers (_curry1/_curry2/_curry3/_curryN) that implements arity-aware partial application with placeholder (R.__) support, and _dispatchable.js lets functions like map transparently delegate to a receiver’s own Fantasy Land method when present. Because every function is independently importable and built on the same small set of currying internals, there is no shared mutable state — the closest thing to a core abstraction is _curryN/_arity, and changing their calling convention would ripple through all 270+ public functions.

Tech Stack Ramda is plain ES2015+ JavaScript with zero runtime dependencies (an empty dependencies object in package.json). Build tooling uses @babel/cli and @babel/preset-env to compile source/ into both a CommonJS src/ directory and an ES-module es/ directory, plus Rollup with rollup-plugin-uglify to produce a UMD bundle at dist/ramda.js and dist/ramda.min.js for direct browser and CDN use. Tests run under Mocha with @babel/register, supplemented by property-based tests via fast-check, and cross-browser testing is wired through Testem using Browserify and Babelify to bundle the test suite against the built dist file. Linting uses ESLint with eslint-plugin-import, and CI runs on GitHub Actions with a separate coverage workflow using nyc.

Code Quality The test directory mirrors source/ nearly one-to-one, with each function’s test file exercising multiple behavioral cases through a shared assertion helper, and many files add property-based tests on top. Core files show small, single-purpose functions with consistent JSDoc blocks used to auto-generate the public docs site, consistent naming, and no custom error classes — errors are thrown as plain Error objects, and there are no first-party TypeScript types (the README points to a community-maintained @types package instead). ESLint enforces style rules and CI runs both linting and the test suite in parallel.

What Makes It Unique Ramda’s defining technical choice is applying automatic currying and data-last argument ordering across essentially its entire public API, plus Fantasy Land-compliant algebraic methods that let user-defined types plug into its higher-order functions via method-detection dispatch. This design predates and influenced later additions like lodash/fp, making Ramda one of the earlier libraries to treat point-free, curried composition as a first-class design constraint for a general-purpose JavaScript toolkit rather than an optional mode.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search