# Ramda — Practical Functional Programming for JavaScript > Auto-curried data-last utility library designed for building composable function pipelines. ## Install Save as a script file and run: # Ramda — Practical Functional Programming for JavaScript ## Quick Use ```bash npm install ramda ``` ```js const R = require('ramda'); const getAdultNames = R.pipe( R.filter(R.propSatisfies(R.gte(R.__, 18), 'age')), R.map(R.prop('name')), R.sort(R.ascend(R.identity)) ); const users = [{ name: 'Bob', age: 25 }, { name: 'Alice', age: 16 }, { name: 'Eve', age: 30 }]; console.log(getAdultNames(users)); // ['Bob', 'Eve'] ``` ## Introduction Ramda is a functional utility library for JavaScript that emphasizes immutability, pure functions, and automatic currying. Unlike Lodash or Underscore, Ramda places the data argument last in every function signature, making it natural to build reusable pipelines through function composition without explicitly mentioning the data. ## What Ramda Does - Provides 300+ auto-curried functions for arrays, objects, strings, and logic - Enables point-free programming with pipe, compose, and converge - Offers lens-based immutable data access and updates for nested structures - Includes predicate combinators like both, either, allPass, and anyPass - Supports transducers for efficient multi-step data transformations ## Architecture Overview Every Ramda function is automatically curried and follows a data-last parameter order. This design lets developers partially apply functions and compose them into pipelines without wrapper utilities. Ramda avoids mutating input data, always returning new values. The library ships as individual modules for tree-shaking and as a single bundle for convenience. ## Self-Hosting & Configuration - Install via npm or load from a CDN for browser use - Import the full library or individual functions for tree-shaking - TypeScript definitions are bundled with the package - No runtime configuration needed; all functions are pure - Works in Node.js, Deno, Bun, and all modern browsers ## Key Features - Every function is automatically curried for partial application - Data-last design enables natural function composition - Lenses provide composable getters and setters for nested data - Comprehensive set of list, object, and logic combinators - Emphasis on immutability with no side effects ## Comparison with Similar Tools - **Lodash** — data-first, imperative style; larger API surface but less composable - **Underscore** — simpler utility belt without currying or data-last design - **fp-ts** — TypeScript-first with algebraic data types; steeper learning curve - **Remeda** — data-last with TypeScript inference and lazy evaluation ## FAQ **Q: Why does Ramda put data last?** A: Data-last ordering lets you partially apply all configuration arguments first, producing a reusable function that accepts data when called. **Q: Is Ramda suitable for TypeScript projects?** A: Yes, though some complex compositions may require explicit type annotations due to currying inference limitations. **Q: How does Ramda compare to native array methods?** A: Native methods like map and filter are data-first and not curried. Ramda wraps similar logic in composable, reusable function pipelines. **Q: Does Ramda support tree-shaking?** A: Yes. Import individual functions like import { pipe, map } from 'ramda' and your bundler will exclude unused code. ## Sources - https://github.com/ramda/ramda - https://ramdajs.com/ --- Source: https://tokrepo.com/en/workflows/asset-5aaa00fc Author: Script Depot