
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
asyncapi-parser
Advanced tools
This package is under development and it has not reached version 1.0.0, what means that 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.
npm install asyncapi-parser
.parse(yamlOrJSONdocument, options) => JSONDocument
The parse
method will take care of parsing and validating the AsyncAPI document. It returns an AsyncAPIDocument, which is a JSON version of the document with all the message payloads converted to JSON Schema Draft 7 schemas and the traits already resolved and merged into the document.
.parseUrl(url, options) => JSONDocument
The parseUrl
method fetches a YAML or JSON document on the given URL and passes its content to the parse
method.
const parser = require('asyncapi-parser');
const doc = parser.parse(`
asyncapi: '2.0.0-rc1'
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
FAQs
JavaScript AsyncAPI parser.
The npm package asyncapi-parser receives a total of 83 weekly downloads. As such, asyncapi-parser popularity was classified as not popular.
We found that asyncapi-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.