0.15.0 • Published 4 years ago

asyncapi-parser v0.15.0

Weekly downloads
853
License
Apache-2.0
Repository
-
Last release
4 years ago

:loudspeaker: ATTENTION:

This package is under development and it has not reached version 1.0.0 yet, what means its API might change without prior notice. Once it reaches its first stable version, we'll follow semantic versioning.


Use this package to parse and validate AsyncAPI documents —either YAML or JSON— in your Node.js or browser application.

This package doesn't support AsyncAPI 1.x.

Install

npm install asyncapi-parser

API

Check out the API page.

Examples

Example passing inline AsyncAPI
const parser = require('asyncapi-parser');

const doc = await parser.parse(`
  asyncapi: '2.0.0'
  info:
    title: Example
    version: '0.1.0'
  channels:
    example-channel:
      subscribe:
        message:
          payload:
            type: object
            properties:
              exampleField:
                type: string
              exampleNumber:
                type: number
              exampleDate:
                type: string
                format: date-time
`);

console.log(doc.info().title());
// => Example
Example passing a URL
const parser = require('asyncapi-parser');

const doc = await parser.parseUrl('https://my.server.com/example-asyncapi.yaml');

console.log(doc.info().title());
// => Example
Example using OpenAPI schemas

Head over to asyncapi/openapi-schema-parser for more information.

Example using RAML data types

Head over to asyncapi/raml-dt-schema-parser for more information.

Develop

  1. Run tests with npm test
  2. Write code and tests.
  3. Make sure all tests pass npm test
  4. Generate new API docs npm run docs
  5. Update bundle for client-side parser npm run bundle
0.15.0

4 years ago

0.14.0

4 years ago

0.13.0

4 years ago

0.12.2

4 years ago

0.12.0

5 years ago

0.11.1

5 years ago

0.10.0

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago

0.8.2

5 years ago

0.8.1

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago