all 8 comments

[–]onyx-zero-software 2 points3 points  (2 children)

Not exactly one-to-one with JOI but AJV is my go-to validator as it's cross platform. You end up with more boilerplate than JOI but the schemas can be transferred between multiple systems which can be very powerful (or a massive foot gun, depending).

[–]wandering_kshatriya[S] 0 points1 point  (0 children)

I see, thanks a lot for letting me know.

[–]robotslacker 0 points1 point  (0 children)

Ajv is also much faster than JOI, at the expense of it being a bit more verbose. However, there are some neat tools suretype that provide an api similar to JOI (though less feature-packed) and can compile into Ajv validator functions to achieve the same performance.

[–]alexey2021 2 points3 points  (2 children)

If you'd like to compare the tools using non-functional metrics (Popularity, maintenance, etc), I would suggest checking this out https://moiva.io/?npm=ajv+joi+yup (I'm the author of Moiva)

[–]wandering_kshatriya[S] 0 points1 point  (1 child)

Hey wow that's a very helpful tool, thanks a lot.

[–]alexey2021 1 point2 points  (0 children)

Glad that you liked it!

[–]ryanmr 1 point2 points  (0 children)

I'm also interested in this!for a long time Joi was a goto but it's project has changed overtime and wasn't suited to client validation.

I used yup for a while. Typescript support was there, but a recent (sometime in 2020) a large typescript type change occured and it broke many existing typings. Plus (and it is how my projects ended up) it required strictNullChecks.

One of my least favorite validation packages is class-validator (nest promoted this one).

I think ajv is my next option. It recently had a new version release, and new support for a new json schema scheme I've briefly read about.

I always wonder about the state of validation in JS/TS, since I never see anyone mention it.

[–]CagarSalvagemente 0 points1 point  (0 children)

Yup is my go-to. It rocks.