body-checker
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "body-checker", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A simple tool to protect your API against bad request parameters", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Body Checker | ||
> A simple tool to protect your API against bad request parameters | ||
[![NPM](https://nodei.co/npm/body-checker.png?downloads=true&stars=true)](https://nodei.co/npm/body-checker/) | ||
[![Build Status](https://travis-ci.org/luceracloud/body-checker.svg?branch=master)](https://travis-ci.org/luceracloud/body-checker) | ||
## Installation | ||
@@ -17,3 +21,3 @@ | ||
#### Body to validate | ||
This is the object or request parameters (`req.body` in express) that you want to validate. | ||
This is the request object (`req.body` in express) that you want to validate. | ||
Currently we only support shallow objects, but if there is an overwhelming need for deep objects, let us know in the issues and we will implement deep validation. | ||
@@ -48,3 +52,3 @@ | ||
#### Callback | ||
Callback is a traditional callback that passes back a detailed error message or the final `req.body` object. The library passes back detailed errors for debugging, but allows you to send your own generic error to the client. This will prevent phishing attacks. See example below. | ||
Callback is a traditional callback(err, data) function. It will pass back detailed errors for debugging or the final `req.body` object. This allows you to send your own generic error to the client to prevent phishing attacks. See example below. | ||
@@ -51,0 +55,0 @@ ## Examples |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9438
7
101