# sindresorhus/on-change

Watch an object or array for changes

Repository: https://github.com/sindresorhus/on-change
Canonical: https://ross.abutalabs.com/products/on-change
Language: JavaScript
License: MIT
License Family: permissive
Topics: watch, object, change-detection, es2015-proxy, nodejs, npm-package
Last push: 2026-02-01T15:01:06+00:00

## Health v2 (maintenance only)
Score: 69/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 65, release rhythm 56, longevity 100
- inputs: {"age_days": 3187, "days_push": 213, "days_rel": 213, "gap_med": 65.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2030, forks 87 (observed 2026-08-28T04:06:07.225413+00:00)

## What it is
A tiny JavaScript library that watches objects and arrays for changes using the ES2015 Proxy API. It recursively detects deep mutations and invokes a callback with the change path, new value, previous value, and method data.

## Use cases
- watch javascript object for changes
- detect deep property mutations in an object
- observe array changes like push or splice
- build reactive state without a framework
- track which object paths were modified
- unsubscribe from object change notifications

## When to choose
- you need lightweight change detection for plain objects and arrays
- you want deep, recursive observation with change paths
- you're in a modern environment supporting ES2015 Proxy

## When to avoid
- you need to support environments without Proxy (older browsers)
- you need a full reactive state management system with stores and subscriptions
- you need to observe non-object types or class instances with private fields

## Facets
- artifact type: library
- maturity: stable
- function: state-management, developer-tools
- domain: web-development, frontend, developer-tools
- platform: browser
- tags: proxy, observer, change-detection, es2015-proxy, npm-package, nodejs, javascript

## Member repositories
- sindresorhus/on-change (main) score 69

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:07.225413+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:59:36.076873+00:00, confidence not recorded.
  - readme: https://github.com/sindresorhus/on-change (fetched 2026-08-28T04:06:07.225413+00:00, sha 430b1cc65446)
  - registry_npm: https://registry.npmjs.org/on-change (fetched 2026-08-29T10:39:36.475546+00:00, sha 4b16cff73707)
- Data as of 2026-08-30T08:39:29.467469+00:00.
