@nattogo/ksqldb
v0.0.1
Published
KsqlDB Client module for Nest framework (node.js)
Downloads
2
Readme
KsqlDB Client for Nestjs
Install
# npm
npm install @nattogo/ksqldb
# yarn
yarn add @nattogo/ksqldb
Usage
// app.module.ts
import { KsqlDBModule } from '@nattogo/ksqldb';
@Module({
imports: [
KsqlDBModule.register({
url: 'http://localhost:8088',
timeout: 3000,
}),
],
})
export class AppModule {}
//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),
});
}
}