Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
alexa-ability-timeout
Advanced tools
import { Ability, events } from 'alexa-ability';
import { handleAbility } from 'alexa-ability-lambda-handler';
import { timeout, TimeoutError } from 'alexa-ability-timeout';
const app = new Ability({
applicationId: 'my-application-id'
});
app.use(timeout(5000)); // 5 seconds
// slow, cancelable operation.
// Listen for the `timeout` event on the request and cancel the request appropriately
app.on(e.launch, function(req, next) {
const cancel = slowCancelableOperation(function(output) {
req.say(output).end(); // send output
});
req.on('timeout', cancel);
});
// slow, operation that we can't cancel.
// just check the `req.timedOut` property to see if it is safe to continue
app.on(e.end, function(req, next) {
slowOperation(function(output) {
if (req.timedOut) return; // halt if timed out
req.say(output).end(); // otherwise send output
});
});
app.onError(function(err, req, next) {
if (err instanceof TimeoutError) {
req.say('Sorry, that took to long. Please try again.').send();
} else {
req.say('Sorry, something went wrong. Please try again later.').end();
}
});
export const handler = handleAbility(app);
timeout(ms) -> middleware
Creates a middleware function that times out the request after
the given ms
have passed.
FAQs
An alexa-ability middleware to prevent stalled requests.
The npm package alexa-ability-timeout receives a total of 5 weekly downloads. As such, alexa-ability-timeout popularity was classified as not popular.
We found that alexa-ability-timeout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.