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

@ir-kit/spec-convert

v0.4.1

Published

Convert between API specification formats — OpenAPI 3, AsyncAPI 3, TypeSpec, Protobuf, JSON Schema. Pair-handler registry; programmatic API; thin wrappers around upstream conversion tools where available.

Readme

@ir-kit/spec-convert

Convert between API specification formats — OpenAPI 3, AsyncAPI 3, TypeSpec, Protobuf, Postman, JSON Schema. Graph-routed dispatcher: registered (from → to) converters compose automatically, so any new edge unlocks every other format combinatorially.

Part of ir-kit.

Install

npm install @ir-kit/spec-convert

Usage

import { convertSpec } from "@ir-kit/spec-convert";

const result = await convertSpec({
  input: "./petstore.yaml",
  to: "postman",
});

if (result.output.kind === "document") {
  console.log(result.output.document);
}

convertSpec auto-detects the source format from the file extension and content (override with from). When no direct (from → to) converter is registered, the dispatcher BFS-routes through intermediate formats — e.g. proto → openapi3 → postman works out of the box.

Registered converters

| From | → | To | | -------- | --- | ------------------------------------- | | openapi3 | → | json-schema, postman, proto, typespec | | postman | → | openapi3 | | proto | → | openapi3 | | typespec | → | openapi3, json-schema, proto |

Any combination not in this table is resolved automatically by chaining edges through the graph — e.g. postman → typespec runs postman → openapi3 → typespec.

OpenAPI → proto

openapi3 → proto writes one proto3 file. Pass upstream: { package: "acme.v1" } to set the package; it defaults to the snake_cased info.title.

| OpenAPI | Protobuf | | ----------------------------------------------- | ----------------------------------------------------------------------------- | | component object schema | message; non-required scalar and enum fields are optional | | allOf of objects | one message with the merged properties | | oneOf / anyOf | message with a oneof variant | | string enum | enum with a <NAME>_UNSPECIFIED = 0 value first | | integer enum | int32 / int64 | | array / additionalProperties | repeated / map<string, T>; nested ones are boxed in a single-field message | | string + date-time, binary/byte | google.protobuf.Timestamp, bytes | | untyped schema, mixed enum | google.protobuf.Value | | $ref to an array, map or scalar component | the referenced type, inlined (proto has no aliases) | | operation | rpc in a <FirstTag>Service, commented with its summary and METHOD /path | | parameters + request body | <Rpc>Request with one field per parameter plus body | | 2xx response | the referenced message, or <Rpc>Response; several 2xx become a oneof | | no parameters / no response body | google.protobuf.Empty |

Property names become snake_case fields with json_name set to the original key. HTTP bindings (google.api.http), security schemes and error responses are not emitted. The proto JSON mapping of enums and oneofs differs from the OpenAPI JSON for the same data. The output uses proto3 optional, which needs protoc 3.15+.

API

| Export | Description | | -------------------------------------------------- | ------------------------------------------------------------- | | convertSpec(opts) | Detect format, dispatch (or chain), return the converted spec | | listConverters() | Inspect every registered direct edge | | SpecFormat, ConvertOutput, ConvertSpecResult | Public types |

ConvertOutput is a discriminated union over { kind: "document" \| "source" \| "files" } — a parsed JS object for OpenAPI-family targets, a source string for TypeSpec / Protobuf, or a { path → content } map for emitters that produce multi-file output.

CLI

ir spec convert ./input.yaml --to openapi3
ir spec convert ./api.proto --to postman

See @ir-kit/cli for full flags.

Limitations

  • typespec → proto only accepts TypeSpec written for @typespec/protobuf, so no route passes through it; openapi3 → proto uses its own converter.
  • AsyncAPI 3 outputs are not yet registered — asyncapi3 works as a load target via @ir-kit/spec-loader, but not yet as a convert target.