
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
cottage-barney
Advanced tools
you can make restful api router, easier with Barney
Cottage-Barney is a restful api router
made with therne/cottage. this router support middleware, HTTP status, URI param, and etc..
$ npm install --save cottage-barney
const cottage = require('cottage');
const Router = require('cottage-barney');
const app = cottage();
const router = new Router(app);
class Index {
// this.params => URI params object like '/:id'
// this.query => GET query object
// this.req => koa.Request
// this.req.body => Body object
// this.res => koa.Response
get() {
// Do something!
this.res.status = Router.status.OK; // We're support http status code's with 'david/http-status'
return 'GET METHOD';
}
post() {
// Do something!
return 'POST METHOD';
}
delete() {
// Do something!
return 'DELETE METHOD';
}
}
router.set('/', new Index());
router.set('/what/:id', new Index()); // barney also support uri param
app.listen(8080);
const cottage = require('cottage');
const Router = require('cottage-barney');
const app = cottage();
const router = new Router(app);
const middleware = function(router) { // 1 argument is required
router.res["status"] = Router.status.CREATED; // You can handling resposne, request, params, query
};
router.use(middleware);
router.set('/', new Route());
/*
Middleware can use with children.
router.set('', {}, [
{
path: '/',
route: new Route(),
middlewares: [
function(route) {
// You can use middleware like this
console.log("This is index!");
}
]
}
]);
*/
app.listen(8080);
FAQs
you can make restful api router, easier with Barney
The npm package cottage-barney receives a total of 0 weekly downloads. As such, cottage-barney popularity was classified as not popular.
We found that cottage-barney 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.