Ramda vs Underscore
Which should you use? A side-by-side look at what each one does, who it suits, what it costs, how hard it is to set up, and where each falls short.
Open source · MIT
A JavaScript utility library for writing functional-style code without changing your data.
Open source · MIT
A JavaScript utility library of helper functions like map, filter and reduce.
The short answer
Choose Ramda if you need…
- JavaScript developers who want to write functional-style data transformations
- Teams that prefer immutable data handling and small composable functions
- Developers building function pipelines from simpler functions
- Projects that can install an npm package and use modern JavaScript modules
Choose Underscore if you need…
- JavaScript developers who want common collection helpers without writing them by hand
- Maintainers of older codebases that need utility functions without changing built-in objects
- Developers who prefer a functional style for transforming data
Side-by-side
| Ramda | Underscore | |
|---|---|---|
| Type | Library | Library |
| Price | Free and open source | Free and open source |
| Licence | MIT | MIT |
| GitHub stars | 24.1k | 27.3k |
| Setup difficulty | Intermediate | Beginner |
| How you get it | Install with a package manager | Install with a package manager |
| Main language | JavaScript | JavaScript |
| Last code update | 26 days ago | 22 days ago |
What each one is
Ramda
Ramda is a JavaScript library of helper functions for transforming data in a functional style. Its functions are automatically curried and take the data as the last argument, so you can chain small functions into pipelines. It is designed so that it never mutates the data you pass in.
Underscore
Underscore.js is a utility library for JavaScript that offers common functional helpers such as each, map, reduce and filter. According to the README, it does this without extending any built-in JavaScript objects. Developers use it to write shorter, more readable code when working with arrays, objects and collections.
Best for
Ramda
- JavaScript developers who want to write functional-style data transformations
- Teams that prefer immutable data handling and small composable functions
- Developers building function pipelines from simpler functions
- Projects that can install an npm package and use modern JavaScript modules
Underscore
- JavaScript developers who want common collection helpers without writing them by hand
- Maintainers of older codebases that need utility functions without changing built-in objects
- Developers who prefer a functional style for transforming data
Strengths
Ramda
- Functions are automatically curried, which makes building new functions from old ones straightforward
- Data is supplied last in arguments, which the README says supports pipeline-style code
- Published as an npm package with browser, Deno and ES module builds
Underscore
- Has a long track record, with about 27,000 stars on GitHub
- Released under the permissive MIT license
- Does not modify core JavaScript objects, so it is less likely to conflict with other code
Not ideal for
Ramda
- Developers who want a general-purpose toolkit mixing paradigms; the README says Ramda is focused on functional style specifically
- Beginners who are not yet comfortable with functions as values, since currying and composition take practice to read
- Projects that need the library to enforce immutability; the README says Ramda does not enforce it
Underscore
- Projects that need only modern built-in array methods, since the README does not compare Underscore to them and many of them now cover the same ground
- Readers looking for a full application framework, because the README describes only a utility library
Trade-offs
Ramda
- Functional style with currying can be harder to read for developers new to the approach
- The README notes that using the 'latest' CDN link risks breaking changes, so versions should be pinned
- Tree-shaking results depend on the bundler and setup, according to the README
Underscore
- The README is short and points to the project website for full documentation and downloads
- The README does not state a current release or version number
- Support is handled through community channels such as Gitter and Stack Overflow rather than a formal support plan
Getting started
Underscore
Clone the repository
git clone https://github.com/jashkenas/underscore.gitFrequently asked questions
What is the difference between Ramda and Underscore?
Ramda: A JavaScript utility library for writing functional-style code without changing your data. Underscore: A JavaScript utility library of helper functions like map, filter and reduce. Ramda suits javascript developers who want to write functional-style data transformations, while Underscore suits javascript developers who want common collection helpers without writing them by hand.
Are Ramda and Underscore free?
Ramda: Free and open source. Underscore: Free and open source.
Which is easier to set up, Ramda or Underscore?
Underscore is easier to get started with (rated beginner); Ramda is rated intermediate and usually needs more setup.
Is Ramda or Underscore more popular?
Underscore has more GitHub stars (27.3k) than Ramda (24.1k). Popularity isn't the same as fit — check which one matches your use case above.
What are other alternatives to Ramda and Underscore?
Other options people compare them with include Immutable.js.
Keep comparing
Built from our catalogue entries for both products: open-source details come from each project's README (AI-assisted, refreshed weekly) and GitHub data; AI-tool details are editorial. Spotted something wrong? Let us know from either product's page.