A simple nodejs wrapper around starting and stopping kafka locally. Can be used for test suites or just running against your service locally.
const KafkaDocker = require('./kafkaDocker');
const KAFKA_TOPIC = 'test';
async function main() {
try {
await KafkaDocker.start();
KafkaDocker.createTopic(KAFKA_TOPIC);
} catch (e) {
console.error(e);
process.exit(1);
}
}
if (require.main === module) {
main();
} else {
module.exports = main;
}