# post-collection-to-yaml

> converter postman collection v2.1 to swagger (openapi 3.0.0) yaml

Latest version **1.0.9** (published 2021-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install post-collection-to-yaml
pnpm add post-collection-to-yaml
yarn add post-collection-to-yaml
bun add post-collection-to-yaml
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2021-03-27 |
| First published | 2020-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Paulo Ariel Pareja |
| Maintainers | smeagoltxc |
| Keywords | postman, 2.1.0, collection, swagger, yaml, openapi, 3.0.0, converter |

## Links

- npm: https://www.npmjs.com/package/post-collection-to-yaml
- Repository: https://github.com/Paulo-Ariel-Pareja/post-collection-2-yaml
- Homepage: https://github.com/Paulo-Ariel-Pareja/post-collection-2-yaml#readme
- Issues: https://github.com/Paulo-Ariel-Pareja/post-collection-2-yaml/issues
- npm.io page: https://npm.io/package/post-collection-to-yaml

## Dependencies (1)

- [js-yaml](https://npm.io/package/js-yaml.md) ^3.13.1

## 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

- 1.0.9 (latest) — 2021-03-27
- 1.0.8 — 2020-10-21
- 1.0.7 — 2020-06-02
- 1.0.6 — 2020-04-28
- 1.0.5 — 2020-04-28
- 1.0.4 — 2020-04-28
- 1.0.3 — 2020-04-25
- 1.0.2 — 2020-04-25
- 1.0.1 — 2020-04-25
- 1.0.0 — 2020-04-25

## README

# How to use

### Install dependency

```
npm i post-collection-to-yaml
```
### Import and use

```
const postToYaml = require('post-collection-to-yaml');

const fileIn = 'path/to/post-collection.json';
const fileOut = 'path/to/save.yaml';

const stringInput = path.join(__dirname, fileIn);
const stringOutput = path.join(__dirname, fileOut);
await postToYaml.convert(stringInput, stringOutput);

```

### Make responses easy!
Save you responses on postman, and we will make example for response on swagger

### Params
Recive 2 params: a string of path and file from Postman Collection and a string of output, place to save you swagger file. Can create your report when lifting your service.

### Personalize some params v1 (Optional)
```
const postToYaml = require('post-collection-to-yaml');

const fileIn = 'path/to/post-collection.json';
const fileOut = 'path/to/save.yaml';

  const options = {
    url: 'localhost:3030',
    description: 'server description',
    title: 'titulo de prueba',
    version: '1.2.3',
    descriptionInfo: 'service description',
    email: 'my.awesome.email@mail.com'
  }

const stringInput = path.join(__dirname, fileIn);
const stringOutput = path.join(__dirname, fileOut);
await postToYaml.convert(stringInput, stringOutput, options);

```

### Personalize some params v2 (Optional, with many servers url's)
```
const postToYaml = require('post-collection-to-yaml');

const fileIn = 'path/to/post-collection.json';
const fileOut = 'path/to/save.yaml';

  const options = {
    title: 'titulo de prueba',
    version: '1.2.3',
    descriptionInfo: 'service description',
    email: 'my.awesome.email@mail.com',
     server: [{
      url: 'localhost:3030',
      description: 'server local'
    }, {
      url: 'localhost:3031',
      description: 'server produccion'
    }
    ]
  }

const stringInput = path.join(__dirname, fileIn);
const stringOutput = path.join(__dirname, fileOut);
await postToYaml.convert(stringInput, stringOutput, options);

```

#### Note for path server
if you put array of server thats cancel the url and description for single server

### Example
![](example.gif)
### Credits
By Paulo Ariel Pareja

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