# amorey/sentineljs

Detect new DOM nodes using CSS selectors (650 bytes)

Repository: https://github.com/amorey/sentineljs
Canonical: https://ross.abutalabs.com/products/sentineljs
Language: JavaScript
License: MIT
License Family: permissive
Topics: javascript, dom
Last push: 2024-07-29T20:50:55+00:00

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

## Adoption (not part of the score)
Stars 1131, forks 38 (observed 2026-08-28T04:03:42.443792+00:00)

## What it is
SentinelJS is a tiny (668 bytes) JavaScript library that detects new DOM nodes matching CSS selectors using dynamically-defined @keyframes animation rules and animationstart events. It lets you register watch functions that fire whenever matching elements are added to the DOM, useful for implementing custom elements and in-place DOM modifications.

## Use cases
- detect when a new DOM element matching a CSS selector is added
- implement custom elements without a framework
- watch for dynamically injected nodes in the DOM
- replace MutationObserver with a faster selector-based watch
- auto-initialize third-party widgets on newly inserted elements

## When to choose
- you need a tiny, dependency-free way to react to new DOM nodes by CSS selector
- MutationObserver performance overhead is a concern for large documents
- you want lightweight custom-element-like behavior in older browsers

## When to avoid
- you need to detect elements with display:none styling (SentinelJS cannot see them)
- your CSS already uses animation-name on overlapping selectors, causing conflicts
- you need to observe attribute changes or node removals, not just additions

## Facets
- artifact type: library
- maturity: maintenance
- function: ui-components, middleware
- domain: web-development, frontend, developer-tools
- platform: browser
- tags: dom-watching, css-selectors, custom-elements, animationstart, micro-library, mutation-observer-alternative, javascript

## Member repositories
- amorey/sentineljs (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:42.443792+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-30T06:38:00.996875+00:00, confidence not recorded.
  - readme: https://github.com/amorey/sentineljs (fetched 2026-08-28T04:03:42.443792+00:00, sha 47bed12fc7f2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
