Skip to content

rkrishn7/ksqldb-client-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f3ba2cb · Oct 24, 2022

History

23 Commits
Oct 24, 2022
Oct 24, 2022
Oct 21, 2022
Oct 21, 2022
Oct 21, 2022
Oct 21, 2022
Oct 21, 2022
Oct 22, 2022
Oct 23, 2022
Oct 21, 2022
Oct 24, 2022
Oct 21, 2022
Oct 24, 2022
Oct 21, 2022
Oct 21, 2022
Oct 21, 2022
Oct 21, 2022
Oct 21, 2022

Repository files navigation

ksqldb-client-node

CI Coverage Status npm version install size semantic-release: angular

A ksqlDB client for NodeJS

Table of Contents

Installation

$ yarn add ksqldb-client-node

Usage

import { KsqlDbClient } from 'ksqldb-client-node';

// Create the client
const client = new KsqlDbClient({
  url: 'http://localhost:8088',
});

// Create a new session to enable communication with the server's HTTP/2 endpoints
const session = client.session();

// Create a new query stream and subscribe to the updates
const queryStream = session.queryStream<QueryResult>({
  sql: 'SELECT * FROM STREAM EMIT CHANGES;',
});

for (await resultSet of queryStream) {
  // do work...
}

// Destroy the session handle
session.close();