Skip to content

docs: add features and output section in readme #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ AsyncDiff is a library that compares two AsyncAPI files and provides information

<!-- tocstop -->

## Features

- Get explicit information about the changes you make to your AsyncAPI files, such as breaking, non-breaking and unclassified changes.
- Different types of output such as JSON, YAML and Markdown.

## Installation

```
Expand Down Expand Up @@ -90,6 +95,37 @@ const output = diff(firstDocument, secondDocument, {
});
```

## Output
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aayushmau5 Not sure, maybe we can present the different possible values in a tabular form?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vinitshahdeo What do you mean by tabular form 🤔 ?


This library supports outputs:

- JSON: `json`
- YAML: `yaml` or `yml`
- Markdown: `markdown` or `md`

```js
const jsonOutput = diff(firstDocument, secondDocument, {
outputType: "json",
});

const yamlOutput = diff(firstDocument, secondDocument, {
outputType: "yaml" | "yml",
});

const markdownOutput = diff(firstDocument, secondDocument, {
outputType: "markdown" | "md",
});
```

With markdown output, you can also choose subtypes of the changes as JSON(`json`) or YAML(`yaml` or `yml`).

```js
const markdownOutput = diff(firstDocument, secondDocument, {
outputType: "markdown" | "md",
markdownSubtype: "json" | "yaml" | "yml",
});
```

## API

Checkout the [index](./docs/modules/index.md) document to see all the APIs this library offers.
Expand Down