# post2swag

> CLI tool to convert Postman collection to swagger (OpenAPI) by providing Postman API key, collection Id and output swagger into file or std-out.

Latest version **0.0.2** (published 2021-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install post2swag
pnpm add post2swag
yarn add post2swag
bun add post2swag
```

Provides the command `post2swag`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2021-10-23 |
| First published | 2021-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 33 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Livshitz |
| Maintainers | livshitz |

## Links

- npm: https://www.npmjs.com/package/post2swag
- npm.io page: https://npm.io/package/post2swag

## Dependencies (2)

- [libx.js](https://npm.io/package/libx.js.md) ^2.0.0
- [postman-to-openapi](https://npm.io/package/postman-to-openapi.md) ^1.18.0

## Recent versions

- 0.0.2 (latest) — 2021-10-23
- 0.0.1 — 2021-10-22

## README

# post2swag

CLI tool to convert Postman collection to swagger (OpenAPI) by providing Postman API key, collection Id and output swagger into file or std-out.

## Features:

1. ⭐️ Handles fetching of remote (cloud stored) Postman collection, format correction and conversion to Swagger file
1. Supports specifying local file or skipping download (reusing downloaded collection)
1. Wraps `postman-to-openapi` to simplify conversion process and cleanup collection json to avoid redundant errors

## Use:

```sh
$ post2swag --postmanApiKey="<key>" --collectionId="<colId>" --output="./output.yml" -q
```

### Options:

```
Usage:
    $ post2swag <input>

    Options:
    -q                  Quite mode, outputs only swagger result
    --postmanApiKey     Postman API key to retrieve the collection
    --collectionId      Postman collection ID
    --input             Specify path to local Postman collection json, will skip downloading via API
    --output            Specify path for the output swagger yaml

    Example:
    $ post2swag --postmanApiKey="<key>" --collectionId="<colId>" --output="./output.yml" -q
```

## Develop:

### Build:

> `$ yarn build`

### Watch & Build:

> `$ yarn watch`

### Run tests:

> `$ yarn test`

### Debug:

> ` Select 'typescript' debug configuration, open file in vscode (to run it specifically) and run debugger`

or:

> ` Select 'Node Attach' debug configuration, run specific file in debug mode (you can pass also args):`

> `$ node --inspect build/Main.js`

---

Scaffolded with [🏗 TS-scaffold](https://github.com/Livshitz/ts-scaffold.git)

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