Skip to content

Commit

Permalink
fix: refactor library to prepare for v3 (#179)
Browse files Browse the repository at this point in the history
Co-authored-by: Matatjahu <[email protected]>
  • Loading branch information
jonaslagoni and magicmatatjahu authored Jun 20, 2023
1 parent c6a64c1 commit 1155c51
Show file tree
Hide file tree
Showing 19 changed files with 13,542 additions and 7,099 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
node_modules
lib
dist
coverage
coverage

.DS_Store
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ npm i @asyncapi/converter

### From CLI

To convert an AsyncAPi document in the console needs the official [AsyncAPI CLI](https://github.com/asyncapi/cli).
To convert an AsyncAPI document in the console needs the official [AsyncAPI CLI](https://github.com/asyncapi/cli).

If you don't have CLI installed, run this command to install the CLI globally on your system:

Expand All @@ -51,7 +51,7 @@ channels:
...
```

Convert to specific version:
Convert to a specific version:

```sh
asyncapi convert streetlights.yml -o streetlights2.yml -t 2.3.0
Expand All @@ -70,7 +70,7 @@ const { convert } = require('@asyncapi/converter')

try {
const asyncapi = fs.readFileSync('streetlights.yml', 'utf-8')
console.log(convert(asyncapi, '2.0.0'));
console.log(convert(asyncapi, '2.6.0'));
} catch (e) {
console.error(e);
}
Expand All @@ -83,7 +83,7 @@ import { convert } from '@asyncapi/converter';
import type { ConvertVersion, ConvertOptions } from '@asyncapi/converter';

try {
const toVersion: ConvertVersion = '2.0.0';
const toVersion: ConvertVersion = '2.6.0';
const asyncapi = fs.readFileSync('streetlights.yml', 'utf-8')
console.log(convert(asyncapi, toVersion));
} catch (e) {
Expand Down
Loading

0 comments on commit 1155c51

Please sign in to comment.