Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Lightweight async/await middleware library (formerly middlewerewolf)
yarn add beware
import Beware from "beware";
let app = new Beware();
// This middleware will execute without issue
app.use(async (ctx, next) => {
ctx.foo = true;
await next();
});
// This middleware will execute, but does not call next()
app.use(async ctx => {
ctx.bar = true;
});
// This middleware will not execute, as the previous middleware
// did not call next()
app.use(async ctx => {
ctx.baz = true;
});
// Register multiple middleware with a single command
app.all([
async ctx => {
ctx.foo = true;
await next();
},
async ctx => {
ctx.bar = true;
await next();
}
]);
// Compose a new middleware execution chain
let fn = app.compose();
// Execute the chain
fn({
initial_context: true
}).then(ctx => {
console.log("All done here!");
}).catch(err => {
console.log("Handle errors like a boss.");
});
git clone git@github.com:aewing/beware.git
cd beware/
make lint
make flow
make test
make build
Pull requests are welcome, but I intend to keep this package as lightweight and future compliant as possible.
Much love to koa-compose, which inspired this package.
FAQs
Lightweight async/await middleware library (formerly middlewerewolf)
The npm package beware receives a total of 6 weekly downloads. As such, beware popularity was classified as not popular.
We found that beware 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.