express-logic-middleware

1.0.2 • Public • Published

express-logic-middleware

a small library of middlewares to help decide which set of middleware you should run

Each middleware takes in 3 arguments

  1. The name (or path) of the request variable you'd like to test.
  2. An array of middleware to run if the evaluation is truthy.
  3. An array of middleware to run if the evaluation is falsey.

ifReqVarIsUndefined - checks if request variable is equal to undefined. ifReqVarIsNull - checks if request variable is equal to null or undefined. ifReqVarIsTrue - checks if request variable is equal to true. ifReqVarIsFalse - checks if request variable is equal to false. ifTruthyInReq - checks if request variable is truthy. ifReqVarIs - Use this if you want to test if a request variable is equal to a specific field.

Package Sidebar

Install

npm i express-logic-middleware

Weekly Downloads

4

Version

1.0.2

License

ISC

Unpacked Size

2.97 kB

Total Files

3

Last publish

Collaborators

  • jason.atallah