New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angry

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angry - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

libs/request.js

67

index.js

@@ -0,3 +1,68 @@

var http = require('http');
module.exports = function(){
return 'angry.js';
var app = function app(req, res){
var pathAndQuery = req.url.split('?', 2);
var path = req.path = pathAndQuery[0];
req.querystring = pathAndQuery[1];
var method = req.method;
var index = -1;
var next = function(){
app.getHandlers(method, path)[++index](req, res, next);
};
next();
};
app.stacks = [];
app.use = function(route, handler){
if(typeof route == 'function'){
handler = route;
route = '*';
}
this.stacks.push({
route: route,
method: '*',
handler: handler
});
};
app.getHandlers = function(method, path){
var handlers = [];
this.stacks.forEach(function(stack){
if(stack.method == '*' || (stack.method.toUpperCase()) == method){
if(stack.route == '*' || stack.route == path)
handlers.push(stack.handler);
}
});
handlers.push(this.errHandler);
return handlers;
};
app.errHandler = function(req, res){
res.statusCode = 404;
res.end('error');
};
app.listen = function(port, callback){
this.server = http.createServer(app);
this.server.listen(port, callback);
return this.server;
};
([ 'get', 'delete', 'post', 'put' ]).forEach(function(method){
app[ method ] = function(route, handler){
app.stacks.push({
route: route,
method: method,
handler: handler
});
};
});
return app;
};
module.exports.Request = require('./libs/request');
module.exports.Response = require('./libs/response');

12

package.json
{
"name": "angry",
"version": "0.0.1",
"version": "0.0.2",
"description": "This is a funny project that born angry. ",

@@ -19,5 +19,11 @@ "main": "index.js",

"bugs": {
"url": "https://github.com/angryjs-io/angry.js/issues"
"url": "https://github.com/angry-js/angry.js/issues"
},
"homepage": "https://github.com/angryjs-io/angry.js"
"homepage": "https://github.com/angry-js/angry.js",
"devDependencies": {
"mocha": "*"
},
"dependencies": {
"mime": "*"
}
}
## angry.js ![npm](https://badge.fury.io/js/angry.js.png)
This is a funny project that born angry.
This is a funny project that born angry.

@@ -15,2 +15,12 @@ ### Installation

var angry = require('angry');
var app = angry();
app.get('/', function(req, res){
res.send('hello world');
});
var server = app.listen(4000, function(){
console.log('server is running at %s', server.address().port);
});
````

@@ -17,0 +27,0 @@

var angry = require('../');
console.log( angry() );
var app = angry();
app.get('/', function(req, res){
res.send('hello world');
});
var server = app.listen(4000, function(){
console.log('server is running at %s', server.address().port);
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc