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

a11ylens

v0.1.0

Published

Static accessibility scanner for Angular component templates.

Readme

A11yLens

A11yLens is a TypeScript Node.js CLI + library that scans Angular component templates (external .component.html and inline templates in .component.ts) for common accessibility issues. It reports findings in console, JSON, or SARIF formats and computes a project score.

No runtime dependencies are required.

Install

npm install -g a11ylens

Or run via npx:

npx a11ylens ./src

CLI

a11ylens [roots...] [options]

Options:

  • --config <path>: Use a specific config file
  • --format <console|json|sarif>: Output format (default: console)
  • --out <path>: Write JSON/SARIF output to a file
  • --min-score <n>: Exit non-zero when score is below n
  • --verbose: Print extra diagnostics

Examples:

a11ylens ./src
npx a11ylens ./apps/admin --format json
npx a11ylens ./src --format sarif --out a11ylens.sarif --min-score 85

Library API

import { runA11yLens } from "a11ylens";

const result = runA11yLens(["./src"], {
  cwd: process.cwd(),
  overrides: { minScore: 90 }
});

console.log(result.score);

Configuration

A11yLens discovers config files by searching upward from the current working directory.

Supported files:

  • .a11ylensrc.json
  • a11ylens.config.json

Example:

{
  "includePatterns": ["*.component.html", "*.component.ts"],
  "ignoreDirs": ["node_modules", ".git", "dist"],
  "ignorePatterns": ["**/legacy/**"],
  "styleFiles": ["./styles.css"],
  "minScore": 85
}

Notes:

  • includePatterns and ignorePatterns use a minimal glob-like matcher (* prefix/suffix).
  • ignoreDirs matches directory names anywhere in the path.
  • styleFiles supports simple selectors (.class, tag, tag.class); complex selectors and CSS variables are ignored.

Output Formats

  • Console: human-friendly output with summary and score.
  • JSON: machine-readable full results.
  • SARIF: static analysis format for GitHub code scanning.

Rules (Built-In)

  • Note: rules are minimal and focus on common Angular template issues.
  • img-alt: images require alt.
  • clickable-nonsemantic: clickable div/span needs semantics.
  • routerlink-text: router links need an accessible name.
  • icon-only-control: icon-only controls need aria-label.
  • color-contrast: text color must meet WCAG AA ratios when color and background-color are available (inline or simple class selectors).

Exit Codes

  • 0: Success
  • 1: Runtime error
  • 2: --min-score provided and score is below the threshold

CI Example (SARIF)

name: A11yLens SARIF

on:
  workflow_dispatch:

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
      - run: npm ci
      - run: npm run build
      - run: node dist/cli/index.js ./src --format sarif --out a11ylens.sarif
      - uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: a11ylens.sarif

Development

npm run build

License

MIT