{"id":20747597,"url":"https://github.com/s3pweb/simple-kafka-promise","last_synced_at":"2025-09-21T02:15:35.526Z","repository":{"id":33275646,"uuid":"157408814","full_name":"s3pweb/simple-kafka-promise","owner":"s3pweb","description":"A simple Kafka's consumer and producer with promises","archived":false,"fork":false,"pushed_at":"2025-05-26T14:04:16.000Z","size":1745,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-16T13:58:06.693Z","etag":null,"topics":["kafka","node-rdkafka","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s3pweb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-13T16:12:48.000Z","updated_at":"2025-05-26T14:04:20.000Z","dependencies_parsed_at":"2025-04-28T12:02:26.196Z","dependency_job_id":"e41e0d8d-844a-4749-a171-6f67b670d88f","html_url":"https://github.com/s3pweb/simple-kafka-promise","commit_stats":null,"previous_names":["sguilly/simple-kafka-promise"],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/s3pweb/simple-kafka-promise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3pweb%2Fsimple-kafka-promise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3pweb%2Fsimple-kafka-promise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3pweb%2Fsimple-kafka-promise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3pweb%2Fsimple-kafka-promise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s3pweb","download_url":"https://codeload.github.com/s3pweb/simple-kafka-promise/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3pweb%2Fsimple-kafka-promise/sbom","scorecard":{"id":793899,"data":{"date":"2025-08-11","repo":{"name":"github.com/s3pweb/simple-kafka-promise","commit":"ac2002341b19f08a534c068790a9059f588014a7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":3,"reason":"4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/npmPublish.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/s3pweb/simple-kafka-promise/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/s3pweb/simple-kafka-promise/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/s3pweb/simple-kafka-promise/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/s3pweb/simple-kafka-promise/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmPublish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/s3pweb/simple-kafka-promise/npmPublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmPublish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/s3pweb/simple-kafka-promise/npmPublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmPublish.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/s3pweb/simple-kafka-promise/npmPublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmPublish.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/s3pweb/simple-kafka-promise/npmPublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/s3pweb/simple-kafka-promise/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/s3pweb/simple-kafka-promise/release.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/npmPublish.yml:36","Warn: npmCommand not pinned by hash: .github/workflows/release.yml:20","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   4 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T08:22:38.908Z","repository_id":33275646,"created_at":"2025-08-23T08:22:38.909Z","updated_at":"2025-08-23T08:22:38.909Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276183775,"owners_count":25599223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kafka","node-rdkafka","typescript"],"created_at":"2024-11-17T08:13:49.492Z","updated_at":"2025-09-21T02:15:35.508Z","avatar_url":"https://github.com/s3pweb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm (scoped)](https://img.shields.io/npm/v/@s3pweb/simple-kafka-promise)](https://www.npmjs.com/package/@s3pweb/simple-kafka-promise)\n\n# Simple kafka promise\n\nThis library is based on [node-rdkafka](https://github.com/Blizzard/node-rdkafka) and aim to provide a simple producer \nand consumer wrapped with promise to allow the use of `async / await` with minimal configuration and overhead.\n\nThis library is fully written in TypeScript.\n\nUse s3pweb/alpine-kafka docker image with node-rdkafka included to shorten build time\n[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/s3pweb/alpine-kafka?sort=semver)](https://hub.docker.com/repository/docker/s3pweb/alpine-kafka)\n(version tag is the version of node-rdkafka).\n\n## Breaking change in v4 from 3.x.x\n- **producer:** By default node-rdkafka will set request.required.acks at -1. You can override it by setting \"request.required.acks\" or \"acks\" in the config object.\n\n## Breaking change in v3 from 2.x.x\n- 2 different producers are available\n\n## Breaking changes in v2 from 1.x.x\n- Producer and consumer now are classes and have a constructor\n- No more direct need for node-config and a logger\n\n## Installation\n\n```bash\nnpm install @s3pweb/simple-kafka-promise\n```\n\n## Configuration\n\nMinimal configuration for the **consumer** is:\n```json\n{ \"metadata.broker.list\": \"0.0.0.0:9094\", \"group.id\": \"test.group\" }\n```\n\nMinimal configuration for the **producer** is:\n```json\n{ \"metadata.broker.list\": \"0.0.0.0:9094\" }\n```\n\nThis project is based on node-rdkafka and supports the same configuration options.\nGo [here](https://github.com/Blizzard/node-rdkafka#configuration) for more details.\n\n## Create a consumer instance\n\n```js\nconst KafkaConsumer = require('@s3pweb/simple-kafka-promise').KafkaConsumer\n\n// Create a new instance\nconst consumer = new KafkaConsumer({ 'metadata.broker.list': '0.0.0.0:9094', 'group.id': 'test.group' }, 1000)\n\n// Connect\nawait consumer.connect(['topicName'])\n\n// Consume messages\nconst messagesArray = await consumer.listen(100, true)\n\n// Disconnect the consumer\nawait consumer.disconnect()\n```\n\nTo use with typescript, just change the import to\n```typescript\nimport { KafkaConsumer } from '@s3pweb/simple-kafka-promise';\n```\n\n### SSL\n\nTo connect with SSL, use:\n```typescript\n  const consumer = new KafkaConsumer({\n    'metadata.broker.list': [\n      'broker1:9093',\n      'broker2:9093',\n      'broker3:9093'\n    ],\n    'group.id': 'test-consumer.group',\n    'security.protocol': 'ssl',\n    'enable.ssl.certificate.verification': true,\n    'ssl.ca.location': '/path/to/the/CA/certificate.crt'\n  })\n```\n\n### SASL\n\nTo connect with SASL, use:\n```typescript\n  const consumer = new KafkaConsumer({\n    'metadata.broker.list': [\n      'broker1:9094',\n      'broker2:9094',\n      'broker3:9094'\n    ],\n    'group.id': 'test-sasl.group',\n    'security.protocol': 'sasl_ssl',\n    'sasl.username': 'username',\n    'sasl.password': 'password',\n    'sasl.mechanisms': 'SCRAM-SHA-256',\n    'enable.ssl.certificate.verification': true,\n    'ssl.ca.location': '/path/to/the/CA/certificate.crt'\n  })\n```\n\n## Create a producer instance\n\n```js\nconst KafkaProducer = require('@s3pweb/simple-kafka-promise').KafkaProducer\n\n// Create a new instance\nconst producer = new KafkaProducer({ 'metadata.broker.list': '0.0.0.0:9094' }, '')\n\n// Connect\nawait producer.connect(['topicName'])\n\n// Produce some messages\nconst offset = await producer.sendMessage(topicName, { message: `My message.` }, 0, null)\n\n// Disconnect\nawait producer.disconnect()\n```\n\nTo use with typescript, just change the import to\n```typescript\nimport { KafkaProducer } from '@s3pweb/simple-kafka-promise';\n```\n\n## Example\n\nTo produce some messages take a look at `./examples/producer.js` and to consume some messages take a look at `./examples/consumer.js`.\n\nIf you have docker, you can use `./examples/docker-compose.yaml` to start one `zookeeper` and one `kafka` stack on your machine. \nThis stack comes with `kafkamanager`  and `kafkadrop` for easy monitoring and debugging.\n\n## Docker\n\nIf you want to build a docker image based on alpine linux, you need to add some packages to the base image. \nGo [here](https://github.com/Blizzard/node-rdkafka/blob/master/examples/docker-alpine.md) for more details.\n\n## New releases\n\nTo create a new release, you only need to add your code (don't forget the mocks and the interfaces) and create a new tag.\nDO NOT push the code to NPM, create a version on Github or send a message for the new release. It will be done automatically by Github Actions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs3pweb%2Fsimple-kafka-promise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs3pweb%2Fsimple-kafka-promise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs3pweb%2Fsimple-kafka-promise/lists"}