oslabs-beta / kafkasocks Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello.
I am currently trying out your project.
Currently when I do:
package.json
{
"name": "kafka-to-socket",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"tsc": "./node_modules/typescript/bin/tsc",
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/node": "^12.20.37",
"typescript": "^4.5.3"
},
"dependencies": {
"kafka-socks": "0.1.10",
"ts-node": "^10.4.0"
}
}
And when I add:
import { Confluent, Consumer, Subject } from 'kafka-socks';
const express = require('express');
const http = require('http');
const { Server } = require('socket.io');
const app = express();
const server = http.createServer(app);
const io = new Server(server);
const KAFKA_BOOTSTRAP_SERVER = ['localhost:31659']
const kafka = new Confluent(KAFKA_BOOTSTRAP_SERVER).create("client-id");
const kafkaConsumer = kafka.consumer({ groupId: "test-group" });
const kafkaSocksConsumer = new Consumer(kafkaConsumer, "topic", 'websocket-event-ID')
const kafkaSocksSubject = new Subject(io, 'websocket-namespace-ID')
I get this error:
I am day to day, not working with JS or typescript so I am a bit confused here?
I tried to install the type
but don't think this exists.
npm i --save-dev @types/kafka-socks
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types%2fkafka-socks - Not found
npm ERR! 404
npm ERR! 404 '@types/kafka-socks@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/simon/.npm/_logs/2021-12-13T00_43_05_792Z-debug.log
Is this something you have seen before?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.