npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@a11yst/source-ranking

v1.0.2

Published

Deterministic source mapping candidate ranking for a11yst

Readme

@a11yst/source-ranking NPM version License: MPL-2.0 NPM total downloads

Deterministic, explainable ranking for static source-mapping candidates.

Purpose

Framework mappers (HTML, React, Next.js, Vue, Nuxt, Angular) produce conservative SourceMappingCandidate[] values. When multiple locations remain plausible, 10a returns ambiguous without selecting a winner.

@a11yst/source-ranking adds a pure ranking layer that can resolve ambiguity only when one location has clearly stronger, independent, consistent evidence.

Matching vs ranking

  • Matching (10b–10g): discovers candidates from static indexes and evidence.
  • Ranking (10h): scores and compares already-built candidates.

Mappers do not call ranking automatically. Audit and report integration arrives in later phases.

Material location grouping

Candidates at the same normalized URI and region (start/end line/column) are grouped into one RankedSourceLocation, regardless of provenance. Multiple provenances at the same location are treated as corroboration.

Scoring

Integer scores are deterministic and centralized:

  • Base confidence: exact 1000, high 300, medium 180, low 80
  • Positive/negative signal weights for selector, component, accessible name, etc.
  • Limited bonuses for independent signal kinds and provenance diversity
  • Small, controlled context adjustments (framework, adapter, scope, route, component, tag, preferred URI)

Ranking never increases confidence. Effective confidence may degrade when conflicts or insufficient evidence are detected.

Resolution rules

Heuristic resolution requires:

  • No conflicting exact locations
  • Top score ≥ minimumResolutionScore (default 340)
  • Winning margin ≥ minimumWinningMargin (default 60)
  • Sufficient independent evidence (not tag/route/framework/scope/preferred URI alone)
  • Medium/low-specific rules documented in code

A single exact location resolves immediately. Two distinct exact locations remain ambiguous regardless of score.

Status

  • resolved: clear winner
  • ambiguous: credible tie or insufficient margin
  • insufficient: evidence too weak (including lone low-confidence candidates)
  • invalid: unsafe input or options

Explainability

Each ranked location includes stable contributions describing score components. Messages are generic and never include source code, secrets, or full selector/text values.

Security

No filesystem, browser, or network access. Context strings and preferred URIs are sanitized. Signal values reuse @a11yst/source-mapping redaction rules.

Limits

Defaults: 500 candidates, 64 signals per candidate. Limits are conservative; reaching a limit prevents silent resolution.

Determinism

Same inputs in any order produce identical scores, ordering, diagnostics, and stable serialization. No machine learning, probabilities, path-length heuristics, Git history, or file popularity.

Future work

  • 10i: remediation recommendations
  • 10j: pipeline integration for mapping + ranking in outputs