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

spec-score

v0.3.4

Published

A lightweight application for OpenAPI spec validation and scoring.

Readme

SpecScore 🚀

npm version CI License: MIT

A lightweight, fast CLI tool for OpenAPI specification validation and quality scoring. SpecScore helps you ensure your API documentation follows best practices and industry standards.

Features

  • Comprehensive Validation - Validates OpenAPI 3.x specifications using swagger-parser
  • Quality Scoring - Evaluates your API spec across 7 key criteria with detailed feedback
  • Multiple Output Formats - Console, Markdown, and HTML reports
  • URL & File Support - Works with local files and remote URLs
  • Fast & Lightweight - Built with Bun for optimal performance
  • Actionable Insights - Get specific suggestions for improvement

Quick Start

Installation

# Install globally via npm
npm install -g spec-score

# Or use with npx (no installation required)
npx spec-score validate ./openapi.yaml

Basic Usage

# Validate an OpenAPI specification
spec-score validate ./openapi.yaml

# Validate from URL
spec-score validate https://api.example.com/openapi.json

# Generate a detailed scoring report
spec-score report ./openapi.yaml

Commands

validate

Validates an OpenAPI specification for structural correctness and compliance.

spec-score validate <file|url>

Examples:

spec-score validate ./api/openapi.yaml
spec-score validate https://petstore3.swagger.io/api/v3/openapi.json

Output includes:

  • Document parsing and validation status
  • API information (title, version, description)
  • Statistics (paths, operations, schemas, parameters)
  • Warnings and suggestions

report

Generates a comprehensive quality report with scoring across multiple criteria.

spec-score report <file|url> [options]

Options:

  • -f, --format <format> - Output format: console, markdown, html (default: console)
  • -o, --output <file> - Output file path (required for markdown/html formats)

Examples:

# Console report (default)
spec-score report ./openapi.yaml

# Markdown report
spec-score report ./openapi.yaml -f markdown -o api-report.md

# HTML report
spec-score report ./openapi.yaml -f html -o api-report.html

Scoring Criteria

SpecScore evaluates your OpenAPI specification across 7 key areas:

| Criteria | Max Points | Description | | -------------------------------- | ---------- | -------------------------------------------------------------------- | | Schema & Types | 20 | Proper data types, schema definitions, and type safety | | Descriptions & Documentation | 20 | Comprehensive descriptions for operations, parameters, and responses | | Paths & Operations | 15 | RESTful naming conventions and CRUD patterns | | Response Codes | 15 | Appropriate HTTP status codes for different scenarios | | Examples & Samples | 10 | Request/response examples for better developer experience | | Security | 10 | Security schemes and authentication methods | | Best Practices | 10 | Versioning, servers, tags, and component reuse |

Grade Scale

  • A (80-100): Excellent - Follows industry best practices
  • B (70-79): Good - Well-structured with minor improvements needed
  • C (60-69): Decent - Several areas for improvement
  • D (50-59): Needs work - Significant improvements required
  • F (0-49): Poor - Major improvements needed across multiple areas

Development

Prerequisites

  • Bun >= 1.0.0
  • Node.js >= 20 (for compatibility)

Setup

# Clone the repository
git clone https://github.com/DhairyaMajmudar/SpecScore.git
cd SpecScore

# Install dependencies
bun install

# Build the project
bun run build

# Start CLI locally
bun run index.ts [command] [flags]

# Run tests
bun test

Support


Made with ❤️ by Dhairya Majmudar