Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expressjs-plus

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expressjs-plus - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

10

lib/index.js

@@ -30,2 +30,3 @@ 'use strict';

var app = express();
// simple handler example
var userHandler = function(param, paramsArray, req, res){

@@ -36,2 +37,5 @@ if(param !== 'user') return false;

};
// this handler allows you to pass res.locals properties between your middlewares seemingly,
// it the parameter was found in locals, it attaches it to paramsArray.
var resLocalsHandler = function(param, paramsArray, req, res){

@@ -48,8 +52,14 @@ if(param in res.locals){

// resLocalsVar was passed in a previous method
var regularFunction2 = function(resLocalsVar, user, id, cb){
// now you can have access to it
console.log(resLocalsVar);
return cb(null);
};
// the responder at the end will use res.locals.status and res.locals.response to issue an HTTP response
app.use(appPlus.GMV(regularFunction), appPlus.GMV(regularFunction2), appPlus.responder);
// adds error handlers, it will add a default error handler along with the list of error handlers passed
// in this case, no error handlers were passed
appPlus.setErrorHandlers();

@@ -56,0 +66,0 @@

2

package.json
{
"name": "expressjs-plus",
"version": "0.1.3",
"version": "0.1.4",
"description": "A pluggable expansion to express js aimed at adding much needed features and helpers.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -38,2 +38,3 @@ <a name="ExpressPlus"></a>

var app = express();
// simple handler example
var userHandler = function(param, paramsArray, req, res){

@@ -44,2 +45,5 @@ if(param !== 'user') return false;

};
// this handler allows you to pass res.locals properties between your middlewares seemingly,
// it the parameter was found in locals, it attaches it to paramsArray.
var resLocalsHandler = function(param, paramsArray, req, res){

@@ -56,8 +60,14 @@ if(param in res.locals){

// resLocalsVar was passed in a previous method
var regularFunction2 = function(resLocalsVar, user, id, cb){
// now you can have access to it
console.log(resLocalsVar);
return cb(null);
};
// the responder at the end will use res.locals.status and res.locals.response to issue an HTTP response
app.use(appPlus.GMV(regularFunction), appPlus.GMV(regularFunction2), appPlus.responder);
// adds error handlers, it will add a default error handler along with the list of error handlers passed
// in this case, no error handlers were passed
appPlus.setErrorHandlers();

@@ -64,0 +74,0 @@

@@ -17,2 +17,3 @@ /**

var app = express();
// simple handler example
var userHandler = function(param, paramsArray, req, res){

@@ -23,2 +24,5 @@ if(param !== 'user') return false;

};
// this handler allows you to pass res.locals properties between your middlewares seemingly,
// it the parameter was found in locals, it attaches it to paramsArray.
var resLocalsHandler = function(param, paramsArray, req, res){

@@ -35,8 +39,14 @@ if(param in res.locals){

// resLocalsVar was passed in a previous method
var regularFunction2 = function(resLocalsVar, user, id, cb){
// now you can have access to it
console.log(resLocalsVar);
return cb(null);
};
// the responder at the end will use res.locals.status and res.locals.response to issue an HTTP response
app.use(appPlus.GMV(regularFunction), appPlus.GMV(regularFunction2), appPlus.responder);
// adds error handlers, it will add a default error handler along with the list of error handlers passed
// in this case, no error handlers were passed
appPlus.setErrorHandlers();

@@ -43,0 +53,0 @@

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