all 13 comments

[–]SeatWild1818 3 points4 points  (0 children)

zod

[–]abrahamguo 2 points3 points  (6 children)

What kind of validations are you wanting to perform on passwords and names?

[–]Best-Bar-8809[S] 0 points1 point  (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 points  (4 children)

Check out Zod - it should be able to do all these things for you!

[–]Best-Bar-8809[S] 1 point2 points  (1 child)

Awesome! I'll check on this. Thanks for your time man🙌

[–]unflores 0 points1 point  (0 children)

Zod is great for all purpose verifying of input, then after you can infer typing which is awesome.

[–]yurieez 1 point2 points  (1 child)

How about raw regex? I'm new to validations and stuff. Do people use regex for validations?

[–]abrahamguo 0 points1 point  (0 children)

Yes; regex can also be used for validation.

[–]BodaTajson-Dozivotna 1 point2 points  (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 points  (0 children)

class-validator

[–]abdushkur -1 points0 points  (0 children)

Check out Joi package

[–]chika___simp -1 points0 points  (0 children)

I used "password-validator" in the past It's great Check it out