Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.44 KB

README.md

File metadata and controls

42 lines (30 loc) · 1.44 KB

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();