
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Originally forked from koajs/common
$ npm install opinion
a builtin routing mechanism
An extensive default middleware stack
DEFAULT_MIDDLEWARE_STACK = {
NoKeepAlive: common.NoKeepAlive,
responseTime: common.responseTime,
logger: common.logger,
compress: common.compress,
conditionalGet: common.conditionalGet,
etag: common.etag,
statics: common.statics,
session: common.session,
csrf: common.csrf,
router: common.router
};
The request ctx has been extended with a send method to send files, and a render method to render views using any consolidate compatible render engine, or plain html files.
And as a extra bonus, socket.io is builtin and can be enabled by configuration flag.
"use strict";
var opinion = require('opinion');
var app = opinion({
middlewareOrder: opinion.DEFAULT_MIDDLEWARE_STACK, // this can be manipulated
// here are some configurations, both general, and middleware specific (by name)
keys: ['78fd9fe83f2af46f2a8b567154db8d2a'],
statics: 'assets',
render: ['views', 'dust'],
socketio: { clientPath: '/js/socket.io.js' }
});
// simple route
app.get('/',
function* () {
yield this.render('hello-world');
}
);
// a CORS enabled proxy to `gist.github.com`
app.get('/snippet/cors/:user/:id', function* () {
this.set('Access-Control-Allow-Origin', '*');
this.set('Access-Control-Allow-Methods', 'GET');
this.set('Access-Control-Allow-Headers', 'Content-Type');
this.type = 'application/javascript';
this.body = require('request')('https://gist.github.com/' + this.params.user + '/' + this.params.id + '/raw');
});
app.listen(prosess.env.PORT || 8080, function () {
console.log("Server listening on %s", this._connectionKey);
});
// websocket push example
setInterval(function () {
app.webSockets.emit('gaga', JSON.stringify(process.memoryUsage()))
}, 3000);
MIT
FAQs
this is my opinion on koa and stuff
We found that opinion 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.