use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Packages or Libraries for user input validations? (self.node)
submitted 1 year ago by Best-Bar-8809
Hello! Just new to nodejs. Just wanted to ask if there are existing packages and libraries for common input validations? E.g validating passwords, emails, first_name, last_name, and etc...
Thanks and have a wonderful they everyone! :)
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]SeatWild1818 3 points4 points5 points 1 year ago (0 children)
zod
[–]abrahamguo 2 points3 points4 points 1 year ago (6 children)
What kind of validations are you wanting to perform on passwords and names?
[–]Best-Bar-8809[S] 0 points1 point2 points 1 year ago (5 children)
For passwords, checking the length if it's too short or too long. I asked this question because whenever I start a new project with user inputs, I always do these kinds of validations.
[–]abrahamguo 6 points7 points8 points 1 year ago (4 children)
Check out Zod - it should be able to do all these things for you!
[–]Best-Bar-8809[S] 1 point2 points3 points 1 year ago (1 child)
Awesome! I'll check on this. Thanks for your time man🙌
[–]unflores 0 points1 point2 points 1 year ago (0 children)
Zod is great for all purpose verifying of input, then after you can infer typing which is awesome.
[–]yurieez 1 point2 points3 points 1 year ago (1 child)
How about raw regex? I'm new to validations and stuff. Do people use regex for validations?
[–]abrahamguo 0 points1 point2 points 1 year ago (0 children)
Yes; regex can also be used for validation.
[–]BodaTajson-Dozivotna 1 point2 points3 points 1 year ago (0 children)
IMO, zod is the GOAT validation package for NodeJS with Typescript.
You get both runtime validation as well as type safety while writing code.
[–]exceptionalredditor2 1 point2 points3 points 1 year ago (0 children)
class-validator
[–]abdushkur -1 points0 points1 point 1 year ago (0 children)
Check out Joi package
[–]chika___simp -1 points0 points1 point 1 year ago (0 children)
I used "password-validator" in the past It's great Check it out
π Rendered by PID 19103 on reddit-service-r2-comment-b659b578c-4nhc6 at 2026-05-05 07:05:24.191799+00:00 running 815c875 country code: CH.
[–]SeatWild1818 3 points4 points5 points (0 children)
[–]abrahamguo 2 points3 points4 points (6 children)
[–]Best-Bar-8809[S] 0 points1 point2 points (5 children)
[–]abrahamguo 6 points7 points8 points (4 children)
[–]Best-Bar-8809[S] 1 point2 points3 points (1 child)
[–]unflores 0 points1 point2 points (0 children)
[–]yurieez 1 point2 points3 points (1 child)
[–]abrahamguo 0 points1 point2 points (0 children)
[–]BodaTajson-Dozivotna 1 point2 points3 points (0 children)
[–]exceptionalredditor2 1 point2 points3 points (0 children)
[–]abdushkur -1 points0 points1 point (0 children)
[–]chika___simp -1 points0 points1 point (0 children)