formcheckr
v1.0.4
Published
A validation helper for forms.
Downloads
1,361
Readme
Form Checkr
Form checkr is a lightweight, dependency free form validator for express applications.
Installing
Now that db helper's dependencies have been installed download and install the db helper npm package to your local project.
npm install formcheckr --save
This will install Form Checkr to your local project's modules.
Usage
To call form checkr within your file you must first import it like so:
var formcheckr = require('formcheckr');
An example of how to use form checkr:
let myForm = formcheckr.isValidForm(req.body, ['email', 'password']);
Form checkr will make sure that the form object (the request body in this example) only contains your permitted fields (in this case email & password) and returns the validated form. If fields are missing then Form checkr will return an error with all the fields that are missing.