# timdown/rangy

A cross-browser JavaScript range and selection library.

Repository: https://github.com/timdown/rangy
Canonical: https://ross.abutalabs.com/products/rangy
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-01-21T23:09:03+00:00

## Health v2 (maintenance only)
Score: 51/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 63, release rhythm 8, longevity 100
- inputs: {"age_days": 4547, "days_push": 224, "days_rel": 669, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2297, forks 362 (observed 2026-08-28T04:06:35.226792+00:00)

## What it is
Rangy is a cross-browser JavaScript library for working with DOM ranges and text selections. It normalizes browser inconsistencies and provides modules for saving/restoring selections, highlighting, and caret manipulation.

## Use cases
- manipulate text selections in the browser consistently across browsers
- save and restore user text selections
- build text highlighting or annotation features
- get or set the caret position in contenteditable elements
- work with DOM ranges without writing browser-specific code

## When to choose
- you need reliable cross-browser selection and range handling in a web app
- you're building rich text editors, highlighters, or annotation tools in vanilla JS
- you need to serialize and restore selections across page updates

## When to avoid
- you're using a modern framework with built-in selection utilities and only target evergreen browsers
- you need server-side DOM manipulation (it's browser-focused)
- you want an actively developed project with ongoing feature work

## Facets
- artifact type: library
- maturity: maintenance
- function: ui-components, developer-tools
- domain: web-development, frontend, browser-extensions
- platform: browser
- tags: dom-range, text-selection, cross-browser, caret, javascript, nodejs

## Member repositories
- timdown/rangy (main) score 51

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:35.226792+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:40:18.706103+00:00, confidence not recorded.
  - readme: https://github.com/timdown/rangy (fetched 2026-08-28T04:06:35.226792+00:00, sha e2c04a1dfdf7)
  - registry_npm: https://registry.npmjs.org/rangy (fetched 2026-08-29T10:20:54.710455+00:00, sha 8d36480af42a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
