Library / SDK
jashkenas/underscore avatar
jashkenas/underscore

Underscore.js adds collection helpers without touching prototypes

JavaScript's utility _ belt

27,319 stars5,422 forksJavaScriptMIT

At a glance

What is it?
The README behind the JavaScript utility-belt library that ships each, map, reduce, and filter as a namespace instead of prototype patches, from its DocumentCloud roots to its support channels.
Who is it for?
The README stays close to fundamentals: a utility-belt library that ships each, map, reduce, and filter without extending core JavaScript objects, documented and distributed through underscorejs.org, with support split across a security policy, Gitter, and StackOverflow. Its history as an open-sourced DocumentCloud component, its Patreon and Tidelift funding, and its code of conduct fill in the rest of the picture.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 28, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The one-sentence definition in the README

The README opens with a single definition: a utility-belt library for JavaScript that provides support for the usual functional suspects, each, map, reduce, and filter, without extending any core JavaScript objects. Every part of that sentence carries weight. The four named methods cover iteration, transformation, aggregation, and selection, which is the bulk of everyday collection work in the language.

The closing clause is the design decision the whole library hangs on. Its methods attach to one exported object rather than patching Array, Object, or Function prototypes, so code using the library never changes how built-in types behave for anyone else. In a codebase where several libraries load side by side, that property is what made it safe to adopt.

Docs, downloads, and support channels

The README routes everything practical to underscorejs.org, naming that site as the place for documentation, license information, tests, and pre-packed downloads. A reader who wants the method reference, the legal terms, the test suite, or a built file for direct download gets all four from the same address.

For questions and problems, the README lists three routes: the project's security policy for vulnerability reports, a Gitter channel for live chat, and StackOverflow, where it notes a search for the library's name turns up existing community answers. The split has a clear shape: a private contact for security matters, a realtime room for quick back-and-forth, and a public archive for anything worth keeping searchable.

Where the library started

One line of the README anchors the project's history: the library is an open-sourced component of DocumentCloud, with a link to the DocumentCloud GitHub organization. DocumentCloud is the platform for organizing, analyzing, and publishing primary source documents, and the collection helpers were extracted from that working codebase rather than written as a standalone exercise.

That origin explains two traits of the project. First, the API was exercised on real document-processing work before the wider public ever called it, so the method set reflects actual needs instead of speculation. Second, the decision to avoid prototype extension fits a product context, where a document platform cannot risk one dependency changing the behavior of another's arrays. The README states the fact plainly and leaves the inference to the reader.

Funding and community rules

The README covers money and conduct in a few lines. Individual supporters are pointed to Patreon, and companies that run the library in production are offered the Tidelift subscription for its npm package, a route that bundles enterprise support and maintenance guarantees around the open source release.

The same page notes that the project adheres to a code of conduct, and that by participating in the project you are expected to uphold this code. Contributors as a group are thanked through the project's contributors page. None of this is unusual for an open source project today, but listing it on so short a front page shows what the maintainer considered necessary for anyone landing on the repository: where to get the code, where to ask for help, how to report a vulnerability, how the project is funded, and the behavioral baseline for joining in.

Why the no-extension rule mattered

The choice to leave core objects alone deserves a closer look, because it set the library apart from contemporaries that did modify prototypes. Prototype extension changes behavior for every script on the page, including third-party code, so two libraries that both patch Array.prototype can conflict in ways that are hard to trace. A namespace approach has none of that risk: the helpers exist only where the library object is in scope.

The trade-off is a small amount of extra typing at each call site, wrapping data in the library object or calling methods with the data as an argument. JavaScript later absorbed many of the same ideas natively, with map, reduce, and filter arriving as built-in array methods, but the namespace pattern this project established stayed a standard way to ship utilities without side effects. The README itself makes no claims about this history; it relies on the definition and the links it provides.

What this front page does not contain

The README is a routing document, not a reference. It names the library, gives the definition, links the documentation site, lists the support channels, credits DocumentCloud, and describes funding and conduct. It does not list the API, show usage examples, discuss performance, or state version numbers and compatibility ranges. Anyone evaluating the project against a specific codebase needs the underscorejs.org reference that the README points to.

That is a reasonable division of labor for a library of this age and size. The repository front page answers identity questions in under a page of text, and the separate site carries the depth. Reading the two together gives the full picture: what the project is, who maintains the surrounding infrastructure, and where the documented details live.

Editorial conclusion

The README stays close to fundamentals: a utility-belt library that ships each, map, reduce, and filter without extending core JavaScript objects, documented and distributed through underscorejs.org, with support split across a security policy, Gitter, and StackOverflow. Its history as an open-sourced DocumentCloud component, its Patreon and Tidelift funding, and its code of conduct fill in the rest of the picture. The method-level detail lives at the linked site, which is exactly where the front page hands the reader off.

Frequently asked questions

What is Underscore.js used for?

It is a JavaScript library that ships collection helpers such as each, map, reduce, and filter. The README calls it a utility-belt library for the usual functional suspects, attached to a single namespace so core JavaScript objects are never modified.

Does the library modify built-in JavaScript objects?

No. The README states it works without extending any core JavaScript objects. Its methods live on one exported object rather than on Array, Object, or Function prototypes, which keeps it compatible with other code loaded on the same page.

Where can I find documentation and downloads?

The README points to underscorejs.org for documentation, license information, tests, and pre-packed downloads. Questions route to the project security policy, a Gitter channel, or StackOverflow.

Official sources

  1. Issues
  2. jashkenas/underscore on GitHub
  3. License: MIT
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/jashkenas-underscore.svg)](https://hysenlabs.com/projects/jashkenas-underscore)