Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
kafka-please
Advanced tools
This npm module lets you start up a Kafka broker (including ZooKeeper) locally. It's meant to facilitate integration tests when you need to test against a Kafka broker.
You need Java in order to run Kafka. This npm module assumes that you already have Java installed.
Usage:
npm install kafka-please --save-dev
const makeKafkaServer = require('kafka-please');
makeKafkaServer().then(kafkaServer => {
// Do stuff that needs a Kafka broker here
console.log('made kafka server', kafkaServer);
console.log('zookeeper listens on', kafkaServer.zookeeperPort);
console.log('kafka listens on', kafkaServer.kafkaPort);
// Remember to shut down the server afterwards!
return kafkaServer.close().then(() => {
console.log('stopped kafka server');
return Promise.resolve();
});
});
Typically, starting a Kafka server takes ~2-3 seconds, and can make your mocha tests time out, if you don't override the timeout:
describe('my integration test', () => {
it('should use kafka', function() {
this.timeout(60000); // Set timeout to 60 seconds, just to be sure
// start kafka, run integration tests etc. here
});
});
fetch.sh
to download Kafka and unzip itnpm install
to get dependenciesnpm test
will run the integration tests.FAQs
A pre-built version of Kafka that can be started and stopped from Node.js
We found that kafka-please demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.