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

openapi-minifier

v1.0.2

Published

A CLI tool by Treblle tp minify OpenAPI V3 Specs by removing redundant information not relevant to AI Agents and LLMs.

Readme

Treblle - API Intelligence Platform

Treblle API Intelligence

WebsiteDocumentationPricing

Treblle is an API intelligence platfom that helps developers, teams and organizations understand their APIs from a single integration point.


OpenAPI Minifier CLI

Latest Version Total Downloads MIT Licence

🧹 A CLI tool that compresses OpenAPI Specification files by up to 80% while preserving all essential details for understanding and integrating the API. Perfect for AI agents and LLMs as it drastically reduces token usage without sacrificing functionality.

Requirements

  • OpenAPI Specification Version 3.X

Features

  • JSON & YAML: Supports both input and output formats
  • Large File Support: Efficiently handles multi-MB specification files
  • Easy To Use Presets: Choose from max, balanced, or min presets
  • Deprecated Path Removal: Remove unused and deprecated endpoints
  • Schema Extraction: Extract inlined schemas into reusable components
  • Smart Minification: Removes verbose elements while preserving API functionality
  • Advanced Optimizations: Schema cleanup, unused component removal, and JSON minification
  • Developer Friendly: Detailed statistics and CLI friendly UI

Installation

npm install -g openapi-minifier

Or use directly with npx:

npx openapi-minifier input.json

Usage

Basic Usage

openapi-minifier input.json
openapi-minifier input.yaml -o output.yaml

Presets

# Maximum reduction (recommended for AI/LLMs)
openapi-minifier input.json --preset max

# Balanced approach (keeps schema descriptions)
openapi-minifier input.json --preset balanced

# Minimal reduction (preserves documentation)
openapi-minifier input.json --preset min

Advanced Options

openapi-minifier input.json \
  --output output.json \
  --preset balanced \
  --keep-examples \
  --keep-descriptions schema-only \
  --remove-deprecated \
  --extract-common-responses \
  --validate \
  --format json

CLI Options

Options:
  -V, --version                        output the version number
  -o, --output <file>                  Output file path
  --preset <preset>                    Minification preset: max, balanced, min (default: "balanced")
  --keep-examples                      Keep example values (default: false)
  --keep-descriptions <mode>           Description handling: all, schema-only, none (default: "schema-only")
  --keep-summaries                     Keep summary fields (default: false)
  --keep-tags                          Keep tag descriptions (default: false)
  --remove-deprecated                  Remove deprecated paths and operations (default: false)
  --extract-common-responses           Extract common responses to components/responses (default: false)
  --extract-common-schemas             Extract common schemas to components/schemas (default: false)
  --validate                           Enable OpenAPI validation (default: false)
  --format <format>                    Output format: json, yaml (default: "json")
  -h, --help                           display help for command

Presets

| Preset | Examples | Descriptions | Schema Cleanup | Remove Deprecated | Extract Components | Size Reduction | Use Case | |--------|----------|-------------|----------------|-------------------|-------------------|----------------|----------| | max | ❌ Remove | ❌ Remove all | ✅ Aggressive | ✅ Remove | ✅ Extract | 🔥 ~78% | Best for AI/LLMs | | balanced | ❌ Remove | 📄 Schema only | ✅ Conservative | ✅ Remove | ✅ Extract | 🔥 ~67% | Recommended default | | min | ✅ Keep | ✅ Keep all | ❌ None | ❌ Keep | ❌ No extraction | ~0% | Preserve documentation |

What Gets Removed

  • JSON minification: Remove all whitespace from JSON output
  • Unused schemas: Remove unreferenced component schemas
  • Schema properties: Remove validation constraints (format, pattern, minLength, etc.)
  • Examples: All request/response example bodies
  • Descriptions: Verbose operation and parameter descriptions
  • Summaries: Operation summary fields
  • Tag descriptions: Keep tag names, remove descriptions

Example Results

Test results using sample OpenAPI specifications included in this repository:

Jira API (2.5 MB)

| Preset | Output Size | Reduction | Examples | Descriptions | Summaries | Tags | Deprecated | Extracted | |--------|-------------|-----------|----------|-------------|-----------|------|------------|-----------| | max | 767 KB | 69.4% | 0 removed | 3,116 removed | 498 removed | 13 removed | 4 removed | 1,262 total | | balanced | 1,021 KB | 59.3% | 0 removed | 725 removed | 498 removed | 13 removed | 4 removed | 1,262 total | | min | 1.6 MB | 35.0% | 0 removed | 0 removed | 0 removed | 0 removed | 0 removed | 0 total |

Stripe API (6.7 MB)

| Preset | Output Size | Reduction | Examples | Descriptions | Summaries | Tags | Deprecated | Extracted | |--------|-------------|-----------|----------|-------------|-----------|------|------------|-----------| | max | 1.8 MB | 72.4% | 0 removed | 8,315 removed | 546 removed | 0 removed | 2 removed | 993 total | | balanced | 2.8 MB | 57.6% | 0 removed | 862 removed | 546 removed | 0 removed | 2 removed | 993 total | | min | 3.2 MB | 51.8% | 0 removed | 0 removed | 0 removed | 0 removed | 0 removed | 0 total |

OpenAPI Sample (1.9 MB)

| Preset | Output Size | Reduction | Examples | Descriptions | Summaries | Tags | Deprecated | Extracted | |--------|-------------|-----------|----------|-------------|-----------|------|------------|-----------| | max | 446 KB | 77.2% | 162 removed | 3,328 removed | 164 removed | 0 removed | 0 removed | 99 total | | balanced | 686 KB | 64.9% | 162 removed | 844 removed | 164 removed | 0 removed | 0 removed | 99 total | | min | 1.4 MB | 25.6% | 0 removed | 0 removed | 0 removed | 0 removed | 0 removed | 0 total |

Support

If you have problems of any kind feel free to reach out via https://treblle.com or email [email protected] and we'll do our best to help you out.

License

Copyright 2025, Treblle Inc. Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php