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

openclaw-component-usage-analytics

v1.0.0

Published

OpenClaw skill for tracking component usage in React/Vue/Web Components codebases

Readme

Component Usage Analytics

OpenClaw skill for tracking component usage in React/Vue/Web Components codebases with AST parsing and SQLite analytics.

Features

  • 🔍 AST Parsing - Accurate component detection via AST analysis
  • 📊 SQLite Database - Store and query usage data efficiently
  • 📈 Trends - Track component adoption over time
  • 🎨 Dashboard - Interactive web UI with charts
  • 🚫 Unused Detection - Find components that aren't being used
  • 📁 Framework Support - React, Vue, Web Components
  • 🔄 CI/CD Ready - Integrate into GitHub Actions

Installation

npm install @openclaw/component-usage-analytics

Quick Start

# Scan your codebase
component-analytics scan ./src --framework react

# View statistics
component-analytics stats

# Find unused components
component-analytics unused --min-usage 5

# Start dashboard
component-analytics dashboard --port 3000

Usage

Scan Command

# Basic scan
component-analytics scan ./src --framework react

# Filter by library
component-analytics scan ./src --library @mycompany/design-system

# Track with commit hash
component-analytics scan ./src --commit $(git rev-parse HEAD)

# Whitelist specific components
component-analytics scan ./src --components Button,Input,Modal

Reports

# JSON export
component-analytics report --format json --output components.json

# CSV export
component-analytics report --format csv --output components.csv

Dashboard

# Start on port 3000
component-analytics dashboard --port 3000

Navigate to http://localhost:3000 to view:

  • Component usage statistics
  • Usage trends over time
  • Unused components list
  • Detailed component information

API Usage

import { ComponentAnalytics } from '@openclaw/component-usage-analytics';

const analytics = new ComponentAnalytics();

// Scan codebase
await analytics.scan('./src', {
  framework: 'react',
  library: '@mycompany/design-system',
});

// Get stats
const stats = analytics.getStats();
console.log(`Total components: ${stats.totalComponents}`);

// Find unused
const unused = analytics.getUnused({ minUsage: 5 });
console.log(`Unused: ${unused.length}`);

// Get trends
const trends = analytics.getTrends('Button', 7);
console.log(trends);

// Export
const json = analytics.export('json');

CI/CD Integration

# .github/workflows/component-analytics.yml
name: Component Analytics
on: [push]
jobs:
  analyze:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: npm i -g @openclaw/component-usage-analytics
      - run: component-analytics scan ./src --framework react
      - run: component-analytics report --output usage.json

Use Cases

  1. Design System Adoption - Track which components are being used
  2. Component Cleanup - Identify unused components for removal
  3. Migration Tracking - Monitor adoption of new component versions
  4. Usage Trends - See component usage over time
  5. Team Reporting - Generate usage reports for stakeholders

Database Schema

SQLite database stores:

  • Components (name, library, first/last seen)
  • Usages (file, line, timestamp, commit)
  • Scans (metadata about each scan)

Performance

  • Scans ~10,000 files in < 30 seconds
  • Handles millions of usage records
  • Dashboard loads instantly

License

MIT