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.
Ware inspired, easily create your own middleware layer using generators via co.
Ware inspired, easily create your own middleware layer using generators via co.
var ware = require('..');
var w = ware()
.use(function *(next) {
this.x = 'hello';
yield next;
})
.use(function *(next) {
this.y = 'world';
yield next;
})
.use(function *(next) {
yield next;
});
w.run({}, {}, function *() {
console.log(this.x, this.y);
});
Print the arguments of input.
var ware = require('..');
var w = ware()
.use(function *(next) {
console.log(this.input); // 1, 2, 3
yield next;
});
w.run(1, 2, 3);
Handles error.
var ware = require('..');
var w = ware()
.use(function *(next) {
if ('42' != this.input[0].life) throw new Error();
yield next;
})
.use(function *(next) {
console.log('yes!');
})
.on('error', function (err) {
console.log('no!');
});
w.run({ life: '41' }); // "no!"
w.run({ life: '42' }); // "yes!"
Create a new list of middleware.
Push a middleware fn(GeneratorFunction) onto the list. If the middleware has an arity of one more than the input to run it's an error middleware.
Runs the middleware functions with input... and optionally calls callback(GeneratorFunction or Function).
Clear the middleware.
MIT
FAQs
Ware inspired, easily create your own middleware layer using generators via co.
The npm package co-ware receives a total of 568 weekly downloads. As such, co-ware popularity was classified as not popular.
We found that co-ware 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.