Socket
Socket
Sign inDemoInstall

req-requires

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.9 to 0.0.10

8

lib/defaultAssertions.js

@@ -8,2 +8,4 @@ var requiredProperty = require('./requiredProperty');

});
return self;
}

@@ -16,2 +18,4 @@

});
return self;
}

@@ -25,2 +29,4 @@

});
return self;
}

@@ -33,2 +39,4 @@

});
return self;
}

2

package.json
{
"name": "req-requires",
"version": "0.0.9",
"version": "0.0.10",
"description": "Add assertions to ExpressJS middleware",

@@ -5,0 +5,0 @@ "main": "./lib/req-requires.js",

@@ -9,3 +9,3 @@ **req-requires.js** is a library that is used to validate properties on the request object in expressjs route handlers.

### app.js
### Setup
The following needs to be placed in the app.js file

@@ -22,3 +22,3 @@ ```javascript

### Usage
### Basic Example

@@ -36,3 +36,3 @@ This will make sure the /testRoute handler has req.query.name

```
Example Request:
Example Request:
GET: http://localhost:3000/testRoute

@@ -46,3 +46,3 @@

```
Example Request:
Example Request:
GET: http://localhost:3000/testRoute?name=brandon

@@ -53,2 +53,7 @@

```
### More Examples
* [Requiring a single property](https://github.com/brandonhamric/req-requires/blob/master/examples/basic/app.js)
* [Requiring properties set from other handlers](https://github.com/brandonhamric/req-requires/blob/master/examples/multipleHandlers/app.js)
* [Chaining requirements](https://github.com/brandonhamric/req-requires/blob/master/examples/chaining/app.js)
* [Returning a custom error when a parameter requirement fails](https://github.com/brandonhamric/req-requires/blob/master/examples/customErrorHandler/app.js)

@@ -63,2 +68,2 @@ ### Validators

```
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc