Gathering detailed insights and metrics for serverless-plugin-offline-kinesis-events
Gathering detailed insights and metrics for serverless-plugin-offline-kinesis-events
Gathering detailed insights and metrics for serverless-plugin-offline-kinesis-events
Gathering detailed insights and metrics for serverless-plugin-offline-kinesis-events
⚡ Serverless plugin that works with serverless-offline to allow offline testing of Serverless functions that are triggered by Kinesis events.
npm install serverless-plugin-offline-kinesis-events
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
15 Stars
26 Commits
2 Forks
7 Watchers
2 Branches
2 Contributors
Updated on Nov 16, 2020
Latest Version
1.1.1
Package Id
serverless-plugin-offline-kinesis-events@1.1.1
Unpacked Size
21.22 kB
Size
6.03 kB
File Count
5
NPM Version
5.7.1
Node Version
9.3.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
1
21
This plugin works with serverless-offline to allow offline testing of serverless functions that are triggered by Kinesis events.
First, start Kinesalite:
docker run --rm -d -p 4567:4567 dlsniper/kinesalite:1.11.4
Then, populate Kinesalite with the appropriate streams (we add a bootstrap command for this):
async function ensureStream() {
const kinesis = new AWS.Kinesis({
endpoint: `${process.env.LAMBDA_KINESIS_HOST}:${process.env.LAMBDA_KINESIS_PORT}`,
region: process.env.LAMBDA_REGION,
apiVersion: '2013-12-02',
sslEnabled: false
})
try {
// Create the stream
await kinesis.createStream({ ShardCount: 1, StreamName: process.env.LAMBDA_KINESIS_STREAM_NAME }).promise()
} catch (err) {
if (err.code === 'ResourceInUseException') {
// Stream already exists, so no problem
winston.info('Kinesis stream already exists')
return
}
throw err
}
}
Start your service:
sls offline
Finally, put records to Kinesalite (this script loads the yml to put from the first command line argument):
const kinesis = new AWS.Kinesis({
endpoint: `${process.env.LAMBDA_KINESIS_HOST}:${process.env.LAMBDA_KINESIS_PORT}`,
region: process.env.LAMBDA_REGION,
apiVersion: '2013-12-02',
sslEnabled: false
})
// Load the record
async function run() {
// Read the records
const records = await BB.all(process.argv.slice(1).map(f => readAsync(f)))
// Write them to Kinesis
return BB.map(records, record => kinesis.putRecord({
Data: JSON.stringify(yaml.safeLoad(record)),
PartitionKey: '0',
StreamName: process.env.LAMBDA_KINESIS_STREAM_NAME
}).promise())
}
run()
.then(() => winston.info('Put records successfully'))
.catch((err) => {
winston.error(`Failed with error ${err.stack}`)
process.exit(2)
})
And you'll see your lambda fire!
See the example/ folder for how we've used this plugin successfully in the real world.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/23 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
113 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More