Skip to main content
Home

Built and signed on GitHub Actions

Types for AsyncAPI in separate package.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
76%
Published
9 months ago (3.0.2)

asyncapi-types

npm npm downloads JSR JSR Score

Types for AsyncAPI in separate package.

Installation

Install types for v3 version of spec

npm i asyncapi-types@^3 -d

Install types for v2 version of spec

npm i asyncapi-types@^2 -d

Usage

import type { AsyncAPIObject } from "asyncapi-types";

const asyncapi: AsyncAPIObject = {
    asyncapi: "3.0.0",
    info: {
        title: "My API",
        version: "1.0.0",
    },
    channels: {
        "my-channel": {
            messages: {
                "my-message": {
                    payload: { type: "string" },
                },
            },
        },
    },
};

TODO

Thanks

This package is copy-pasted from @asyncapi/parser-js/spec-types with Apache 2.0 license to use only types and not the whole parser.

License

This project is licensed under the Apache 2.0 License.

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@kravets/asyncapi-types

Import symbol

import * as asyncapi_types from "@kravets/asyncapi-types";
or

Import directly with a jsr specifier

import * as asyncapi_types from "jsr:@kravets/asyncapi-types";

Add Package

pnpm i jsr:@kravets/asyncapi-types
or (using pnpm 10.8 or older)
pnpm dlx jsr add @kravets/asyncapi-types

Import symbol

import * as asyncapi_types from "@kravets/asyncapi-types";

Add Package

yarn add jsr:@kravets/asyncapi-types
or (using Yarn 4.8 or older)
yarn dlx jsr add @kravets/asyncapi-types

Import symbol

import * as asyncapi_types from "@kravets/asyncapi-types";

Add Package

vlt install jsr:@kravets/asyncapi-types

Import symbol

import * as asyncapi_types from "@kravets/asyncapi-types";

Add Package

npx jsr add @kravets/asyncapi-types

Import symbol

import * as asyncapi_types from "@kravets/asyncapi-types";

Add Package

bunx jsr add @kravets/asyncapi-types

Import symbol

import * as asyncapi_types from "@kravets/asyncapi-types";