Settings

Theme

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

101node.io

1 points by banna2 7 years ago · 2 comments

Reader

dvdhnt 7 years ago

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/

  • banna2OP 7 years ago

    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?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection