
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
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 2 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.