Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

asyncapi/ts-nats-template

This branch is 1 commit ahead of, 17 commits behind master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f836bd4 Β· Oct 18, 2023
Jun 29, 2023
Jan 15, 2021
Aug 11, 2023
Nov 29, 2021
Aug 11, 2023
Nov 29, 2021
Sep 27, 2022
Aug 11, 2023
Aug 11, 2023
Jan 7, 2022
Mar 3, 2021
Mar 3, 2021
Dec 20, 2021
Sep 27, 2022
May 24, 2022
Jul 5, 2022
Mar 13, 2021
Jan 7, 2022
Dec 20, 2021
Oct 18, 2023
Oct 18, 2023

Repository files navigation

TypeScript/Node.js NATS template

All Contributors

This is a TypeScript/Node.js NATS template for the AsyncAPI generator.

This template is for generating a TypeScript/Node.js wrapper for the NATS client based on your AsyncAPI document. The template is based on the nats.js library and can be used as both a TypeScript and Node.js library.

Have you found a bug or have an idea for improvement? Feel free to contribute! See the contribution guidelines for how to do so.

How to use

Example use-cases can be found under examples.

Information about the generated files and a description can be found under the documentation folder.

Requirements

  • @asyncapi/generator < v2.0.0 >v1.1.1

Install the generator through npm or run it from docker official installer.

Template Parameters

These are the available template parameters:

Parameter Type Description
generateTestClient Boolean Use this parameter to generate the test client. Add the following to the CLI when generating your code --param "generateTestClient=true"
promisifyReplyCallback Boolean Use this parameter to change from the default regular callback when using the request operation. Add the following to the CLI when generating your code --param "promisifyReplyCallback=true"

Features

  • Supports wildcard channels. AsyncAPI describes the channel path to be defined as RFC 6570 URI. So a channel containing a wildcard needs to be defined with parameters such as smartylighting/streetlights/{wildcard}.
  • Supports test/mirror client for testing or other useful scenarios.
  • This template can be used as a NodeJS library.
  • Generates payload models using the AsyncAPI model generation library.

Restrictions

  • Empty objects are not supported, use null types instead.

Contributing

Before contributing, please read the CONTRIBUTING document.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Jonas Lagoni

πŸ› 🚧 πŸ’» πŸ“– πŸ€” πŸ’¬ ⚠️

Maciej UrbaΕ„czyk

πŸ‘€

Lukasz Gornicki

πŸš‡ πŸ‘€

Fran MΓ©ndez

πŸ‘€

Colin Sullivan

πŸ‘€

Alberto Ricart

πŸ‘€

Alejandra Quetzalli

πŸ‘€