![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
@middy/do-not-wait-for-empty-event-loop
Advanced tools
Readme
"Do not wait for empty event loop" middleware for the middy framework, the stylish Node.js middleware engine for AWS Lambda
This middleware sets context.callbackWaitsForEmptyEventLoop
property to false
.
This will prevent Lambda from timing out because of open database connections, etc.
To install this middleware you can use NPM:
npm install --save @middy/do-not-wait-for-empty-event-loop
By default the middleware sets the callbackWaitsForEmptyEventLoop
property to false
only in the before
phase,
meaning you can override it in handler to true
if needed. You can set it in all steps with the options:
runOnBefore
(defaults to true
) - sets property before running your handlerrunOnAfter
(defaults to false
)runOnError
(defaults to false
)const middy = require('@middy/core')
const doNotWaitForEmptyEventLoop = require('@middy/do-not-wait-for-empty-event-loop')
const handler = middy((event, context, cb) => {
cb(null, {})
})
handler.use(doNotWaitForEmptyEventLoop({runOnError: true}))
// When Lambda runs the handler it gets context with callbackWaitsForEmptyEventLoop property set to false
handler(event, context, (_, response) => {
expect(context.callbackWaitsForEmptyEventLoop).toEqual(false)
})
For more documentation and examples, refers to the main Middy monorepo on GitHub or Middy official website.
Everyone is very welcome to contribute to this repository. Feel free to raise issues or to submit Pull Requests.
Licensed under MIT License. Copyright (c) 2017-2018 Luciano Mammino and the Middy team.
FAQs
Middleware for the middy framework that allows to easily disable the wait for empty event loop in a Lambda function
The npm package @middy/do-not-wait-for-empty-event-loop receives a total of 22,123 weekly downloads. As such, @middy/do-not-wait-for-empty-event-loop popularity was classified as popular.
We found that @middy/do-not-wait-for-empty-event-loop demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.