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

api-collection-converter

v1.0.0

Published

Convert API collections between formats (Postman, Swagger, OpenAPI, Insomnia, HAR, cURL, RAML, GraphQL, WSDL, AWS Gateway) via ATA hub format

Readme

api-collection-converter

Convert API collections between formats — Postman, Swagger, OpenAPI, Insomnia, HAR, cURL, RAML, GraphQL, WSDL, and AWS API Gateway.

All conversions route through ATA (the hub format): Source -> ATA -> Target.

Install

npm install api-collection-converter

Quick Start

import { postman, swagger, openapi, curl, har, insomnia, ata, graphql } from 'api-collection-converter';

// Postman -> ATA
const result = postman.toAta(postmanJson);

// ATA -> Postman
const out = ata.toPostman(ataCollection);

// Postman -> Swagger (via ATA hub)
const spec = postman.toSwagger(postmanJson);

// Swagger -> cURL commands
const cmds = swagger.toCurl(swaggerJson);

// OpenAPI 3.x -> Postman
const pm = openapi.toPostman(openapiSpec);

// cURL -> ATA
const parsed = curl.toAta("curl -X GET 'https://api.example.com/users'");

// HAR -> Swagger
const sw = har.toSwagger(harLog);

// Insomnia -> Postman
const collection = insomnia.toPostman(insomniaExport);

Supported Formats

| Format | Import (toAta) | Export (fromAta) | |--------|:-:|:-:| | Postman v2.1.0 | Yes | Yes | | Swagger 2.0 | Yes | Yes | | OpenAPI 3.x | Yes | Yes | | cURL | Yes | Yes | | HAR 1.2 | Yes | Yes | | Insomnia v4 | Yes | Yes | | GraphQL Introspection | Yes | - | | RAML | Yes* | - | | WSDL/SOAP | Yes* | - | | AWS API Gateway | Yes | - |

* Requires optional peer dependency (js-yaml for RAML, fast-xml-parser for WSDL).

API

Every facade exposes toAta() plus to<Format>() methods for cross-format conversion. All functions are synchronous and return a ConvertResult:

interface ConvertResult<T> {
  success: boolean;
  data?: T;
  warnings?: string[];
  error?: string;
}

Facades

postman.toAta(json)          postman.toSwagger(json)       postman.toOpenApi(json)
postman.toCurl(json)         postman.toHar(json)           postman.toInsomnia(json)

swagger.toAta(json)          swagger.toPostman(json)       swagger.toOpenApi(json)
swagger.toCurl(json)         swagger.toHar(json)           swagger.toInsomnia(json)

openapi.toAta(json)          openapi.toPostman(json)       openapi.toSwagger(json)
openapi.toCurl(json)         openapi.toHar(json)           openapi.toInsomnia(json)

curl.toAta(str)              curl.toPostman(str)           curl.toSwagger(str)
curl.toOpenApi(str)

har.toAta(json)              har.toPostman(json)           har.toSwagger(json)
har.toCurl(json)

insomnia.toAta(json)         insomnia.toPostman(json)      insomnia.toSwagger(json)
insomnia.toCurl(json)

graphql.toAta(introspection) graphql.toPostman(introspection) graphql.toSwagger(introspection)

raml.toAta(yamlStr)          raml.toPostman(yamlStr)       raml.toSwagger(yamlStr)

wsdl.toAta(xmlStr)           wsdl.toPostman(xmlStr)        wsdl.toSwagger(xmlStr)

awsGateway.toAta({ apiDetails, resources, baseUrl })
awsGateway.toPostman(...)    awsGateway.toSwagger(...)

ata.toPostman(collection)    ata.toSwagger(collection)     ata.toOpenApi(collection)
ata.toCurl(collection)       ata.toHar(collection)         ata.toInsomnia(collection)

Generic convert() Function

import { convert } from 'api-collection-converter';

const result = convert('postman', 'swagger', postmanJson);

Custom Logger

import { postman } from 'api-collection-converter';

const result = postman.toAta(json, {
  logger: {
    debug: console.debug,
    info: console.info,
    warn: console.warn,
    error: console.error,
  }
});

Optional Dependencies

For RAML and WSDL support, install the optional peer dependencies:

# For RAML parsing
npm install js-yaml

# For WSDL/XML parsing
npm install fast-xml-parser

These are not required for other formats.

Exported Utilities

import {
  removeCommentsFromJSON,   // Strip comments from JSON-like strings
  prepareExportJson,        // Remove internal DB fields from export objects
  dereferenceLocalRefs,     // Resolve $ref pointers in OpenAPI/Swagger specs
  buildExampleFromSchema,   // Generate example values from JSON Schema
  generateId,               // UUID generator with fallback
  ITEM_CATEGORY,            // ATA category constants
  VAR_TYPE,                 // ATA variable type constants
  REQ_METHOD,               // HTTP method constants
} from 'api-collection-converter';

Exported Types

import type {
  AtaCollection, AtaRequest, AtaFolder,
  PostmanCollection, SwaggerSpec, OpenApiSpec,
  HarLog, CurlCommand, InsomniaExport,
  GraphQLIntrospection, WsdlDefinition,
  ConvertResult, ConvertOptions, FormatName, Logger,
} from 'api-collection-converter';

Build

npm run build      # ESM + CJS + .d.ts
npm test           # Run all tests
npm run typecheck  # TypeScript check

License

MIT