Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pirumu/ksqldb

KsqlDB Client module for Nest framework (node.js)
https://github.com/pirumu/ksqldb

Last synced: 29 days ago
JSON representation

KsqlDB Client module for Nest framework (node.js)

Awesome Lists containing this project

README

        

# KsqlDB Client for Nestjs ![logo](https://docs.ksqldb.io/en/latest/img/logo.png)

## Install

```
# npm
npm install @nattogo/ksqldb
# yarn
yarn add @nattogo/ksqldb
```

## Usage
```ts
// app.module.ts
import { KsqlDBModule } from '@nattogo/ksqldb';

@Module({
imports: [
KsqlDBModule.register({
url: 'http://localhost:8088',
timeout: 3000,
}),
],
})
export class AppModule {}
```

```ts
//app.service.ts
import { KsqldbService } from '@nattogo/ksqldb';
import { Injectable } from '@nestjs/common';

@Injectable()
export class AppService {
constructor(private readonly ksqldbService: KsqldbService) {
}

pushQuery() {
this.ksqldbService.pushQuery('SELECT * FROM STREAM EMIT CHANGES;').subscribe({
next: (data) => console.log(data),
});
}
}

```