Package Exports
- murmur2-partitioner
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (murmur2-partitioner) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
murmur2 Partitioner
This JS-script calculates the partition based on a key and the amount of partitions for a JS Kafka producer in way consistent to the default Java Kafka client.
Install it
npm install
Test it
npm test
Use it
const partitioner = require('path/to/index')
partitioner.partition('key', 5) // Second parameter being the total number of partitions