kinesis-parser
v1.1.1
Published
Small library for reading Kinesis `event.Records` in Lambda.
Downloads
2
Readme
Kinesis Parser
Small library for reading Kinesis event.Records
in Lambda.
Installing
npm install kinesis-parser --save
Parsing plain text messages
const KinesisParser = require('kinesis-parser')
exports.handler = (event, context, callback) => {
const messages = KinesisParser.parse(event.Records)
// filters non-kinesis records and base64 decodes kinesis.data in one pass
// messages => [{data": "Hello World"}]
}
Parsing JSON messages
const KinesisParser = require('kinesis-parser')
exports.handler = (event, context, callback) => {
const messages = KinesisParser.parseJSON(event.Records)
// filters non-kinesis records and base64 decodes kinesis.data in one pass
// parses JSON and discards records that do not parse
// messages => [{data": {"msg":"Hello World"}},{...},...]
}