Live data from Hacker News

How to make input validation in Express.js app simple and clean

101node.io

1–3 of 3 posts

Re: How to make input validation in Express.js app simple and clean

#2
I'm not a fan of the package used here, the syntax of chaining functions to validate a single input within your routing file, something that should likely be fairly static.

At my old company, we used `whitelister`. We created it in-house then open sourced it [1]. There is JSON schema, and we could have moved on to that, but it was too much for what we needed.

1. https://spireteam.github.io/whitelister/

Re: How to make input validation in Express.js app simple and clean

#3
post #2

I'm not a fan of the package used here, the syntax of chaining functions to validate a single input within your routing file, something that should likely be fairly static. At my old company, we used `whitelister`. We created it in-house then open sourced it [1]. There is JSON schema, and we could have moved on to that, but it was too much for what we needed. 1. https://spireteam.github.io/whitelister/

Nice man, Quite handy, Thanks for sharing,

But What about custom validations if I want to do async validation your package allows that?

or If I want to validate an array of items or array of object properties?