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

doble-id-scanner

v1.0.1

Published

Scan React, Vue, Angular and HTML files for duplicate id attributes

Readme

🔍 doble-id-scanner

Scan your React, Vue, Angular and HTML projects for doble id attributes — no installation required.

Usage

# Scan current directory (default)
npx doble-id-scanner

# Scan a specific folder
npx doble-id-scanner ./src

# The path is always optional and can go anywhere in the command
npx doble-id-scanner --file ./src
npx doble-id-scanner ./src --file --json

Options

| Option | Description | |--------|-------------| | [path] | Directory to scan. Optional — defaults to where you run the command. Can appear before or after any flag. | | --path <dir> | Explicit path flag, alternative to positional path | | --dynamic | Include dynamic id bindings (id={expr}, :id="expr") in the analysis. Excluded by default since their value is unknown at build time. | | --file | Save the report to idScan.md (or idScan.json with --json). Only creates the file if dobles are found. | | --json | Format output as JSON — on console or in the file if combined with --file | | --no-build | Exclude build output folders from the scan | | --all | Show all found ids, not just dobles | | --help, -h | Show help |

Examples

# Basic scan of current directory
npx doble-id-scanner

# Scan a specific folder
npx doble-id-scanner ./src

# Save report as idScan.md (only if dobles found)
npx doble-id-scanner --file

# Save report as idScan.json
npx doble-id-scanner --file --json

# Include dynamic id bindings (JSX id={expr}, Vue :id="expr")
npx doble-id-scanner --dynamic

# Full combo: specific folder, dynamic ids, save as JSON file
npx doble-id-scanner ./src --dynamic --file --json

# Exclude build output dirs
npx doble-id-scanner --no-build

# Flags and path can go in any order
npx doble-id-scanner --file --dynamic ./src
npx doble-id-scanner ./src --file --dynamic

Example output

🔍 doble ID Scanner
────────────────────────────────────────────────────
Scanning : /my-project
Build dirs: (includes build output: dist, .next, build…)
Dynamic IDs: excluded (use --dynamic to include)
Extensions: .html, .jsx, .tsx, .vue, .js, .ts
────────────────────────────────────────────────────

Found 24 file(s) to scan...

❌  Found 2 doble ID(s):

  id="submit-btn"
  Appears 2 times:
    src/components/LoginForm.jsx:14
    → <button id="submit-btn" onClick={handleLogin}>
    src/components/RegisterForm.vue:22
    → <button id="submit-btn" type="submit">

  id="header"
  Appears 3 times:
    src/layouts/MainLayout.jsx:5
    → <header id="header">
    src/components/Modal.tsx:11
    → <div id="header" className="modal-header">
    dist/index.html:1
    → <header id="header">built output</header>

────────────────────────────────────────────────────
Summary: 2 doble id(s) found across 24 file(s) scanned.
Tips: run with --file to save as idScan.md · --dynamic to include dynamic id bindings

About dynamic IDs

By default, the scanner only analyzes static id values — ones whose value is known in the source code:

<div id="my-header">...</div>       ✅ scanned by default

With --dynamic, it also analyzes dynamic bindings where the value is a runtime expression:

<div id={userId}>...</div>          ⚡ only with --dynamic
<div :id="computedId">...</div>     ⚡ only with --dynamic
<div v-bind:id="someVar">...</div>  ⚡ only with --dynamic

Dynamic ids are excluded by default because their actual value is unknown at scan time — two components using id={props.id} are not necessarily dobles. Use --dynamic when you want to audit all id bindings regardless.

Scanned folders

By default, everything in the target directory is scanned, including build output:

| Folder | Framework | |--------|-----------| | dist | Vite, Rollup, generic | | build | Create React App, Angular | | .next | Next.js | | .nuxt | Nuxt.js | | out | Next.js static export | | .output | Nuxt 3 | | .svelte-kit | SvelteKit | | .vercel | Vercel build cache | | .netlify | Netlify build cache | | storybook-static | Storybook | | www | Ionic / Capacitor |

Use --no-build to exclude these.

Always ignored: node_modules, .git, coverage, .cache, .turbo.

Scanned file types

.html · .jsx · .tsx · .vue · .js · .ts

Exit codes

| Code | Meaning | |------|---------| | 0 | No dobles found | | 1 | dobles found |

This makes it easy to use in CI/CD pipelines:

# GitHub Actions example — fail the build if doble IDs are found
- name: Check for doble IDs
  run: npx doble-id-scanner ./src --dynamic

Why does this matter?

  • doble ids break accessibility (screen readers, ARIA relationships)
  • They break anchor links (href="#myId" only jumps to the first match)
  • document.getElementById() only returns the first element — silent bugs
  • They are invalid HTML per the W3C spec

License

MIT