In this tutorial I will teach you how to validate user input using an Express middleware module called express-validator.
express-validator is built on top of another open-source library called validator. validator is basically a library of validation functions. Some of it's popular functions include isEmail
and isNumeric
but you can see a full list here. express-validator makes all the functions in validator available in a way that works nicely with Node and Express.
###Installation
Installing express-validator is easy when you use npm. Just input the following command:
npm install express-validator