# @readme/postman-to-openapi

> Convert postman collection to OpenAPI spec

Latest version **4.1.0** (published 2023-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @readme/postman-to-openapi
pnpm add @readme/postman-to-openapi
yarn add @readme/postman-to-openapi
bun add @readme/postman-to-openapi
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.1.0 |
| Published | 2023-05-01 |
| First published | 2023-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 6 |
| Unpacked size | 74.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | dannobytes, gkoberger, domharrington, mjcuva, kanadgupta, jonursenbach, rafegoldberg, dashron, iliast |
| Keywords | swagger, OpenAPI, postman, collection, convert, converter, transform, specification, yml |

## Links

- npm: https://www.npmjs.com/package/@readme/postman-to-openapi
- Repository: https://github.com/readmeio/postman-to-openapi
- Homepage: https://github.com/readmeio/postman-to-openapi#readme
- Issues: https://github.com/readmeio/postman-to-openapi/issues
- npm.io page: https://npm.io/package/@readme/postman-to-openapi

## Dependencies (6)

- [marked](https://npm.io/package/marked.md) ^4.3.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0
- [mustache](https://npm.io/package/mustache.md) ^4.2.0
- [jsonc-parser](https://npm.io/package/jsonc-parser.md) 3.2.0
- [lodash.camelcase](https://npm.io/package/lodash.camelcase.md) ^4.3.0
- [@readme/http-status-codes](https://npm.io/package/@readme/http-status-codes.md) ^7.2.0

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 4.1.0 (latest) — 2023-05-01
- 4.0.0 — 2023-03-03

## README

# @readme/postman-to-openapi

🛸 Convert Postman Collection v2.1/v2.0 to OpenAPI v3.0.

Or in other words, transform [this specification](https://schema.getpostman.com/json/collection/v2.1.0/collection.json) and [also this](https://schema.getpostman.com/json/collection/v2.0.0/collection.json) to [this one](http://spec.openapis.org/oas/v3.0.3.html)

[![build](https://github.com/readmeio/postman-to-openapi/workflows/Build/badge.svg)](https://github.com/readmeio/postman-to-openapi/actions)
[![npm version](https://img.shields.io/npm/v/@readme/postman-to-openapi
)](https://npm.im/@readme/postman-to-openapi)
[![CodeQL](https://github.com/readmeio/postman-to-openapi/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/readmeio/postman-to-openapi/actions/workflows/codeql-analysis.yml)

## Installation

Using `npm`:

```bash
npm i @readme/postman-to-openapi
```

Using `yarn`:

```bash
yarn add @readme/postman-to-openapi
```

## Quick Usage

As a library

```js
const postmanToOpenAPI = require('postman-to-openapi')

// Postman collection
const postmanCollection = './path/to/postman/collection.json'
// Output OpenAPI Path
const outputFile = './api/collection.yml'

postmanToOpenAPI(postmanCollection, outputFile, { defaultTag: 'General' })
  .then(result => {
    console.log(`OpenAPI specs: ${result}`)
  })
  .catch(err => {
    console.log(err)
  })
```

## Documentation

All features, usage instructions and help can be found in the [Documentation page](https://joolfe.github.io/postman-to-openapi/)

## Differences from `postman-to-openapi`

There are some small differences between this library and the [postman-to-openapi](https://npm.im/postman-to-openapi) upstream:

* Does not ship with a CLI component.
* Has protections in place to prevent `undefined` statuses from being set.
* Has no `version` property on the exported method to determine which version you're running as this is unnecessary without a CLI component.

---
_Source: https://npm.io/package/@readme/postman-to-openapi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
