Joi
joi.dev
2
Leaving SiteNav
External Link Disclaimer
You are about to visit joi.dev. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
Joi is a powerful schema description language and data validator for JavaScript, originally developed as part of the hapi.js ecosystem by Eran Hammer and the hapi team. It offers over 150 built-in validators covering strings, numbers, dates, arrays, objects, and binary types, with chainable rules that read like natural English sentences. Joi excels at describing complex relationships between fields declaratively, supporting cross-field references through Joi.ref, conditional schemas using the when method, and field dependency operators such as with, without, or, and, xor, oxor, and nand. The library provides robust coercion capabilities, automatically converting string inputs to numbers, dates, or booleans when the target type requires it, which is particularly useful for parsing query parameters and form submissions. Joi generates rich, actionable error objects containing detailed information about each validation failure, including the field path, type code, and contextual data, enabling developers to build precise user feedback systems. The extension system allows teams to create entirely new schema types with custom rules, coercions, and chainable methods, and distribute them as reusable npm packages. Joi also supports schema variants through the alter and tailor methods, enabling the same base schema to produce different validation rules depending on the context or user role. The library is extensively documented with an interactive sandbox on its official website, API reference guides for each major version, and a comprehensive changelog. The project is deployed on Netlify and maintained as a community-driven open source project under the BSD-3-Clause license.
Statistics
2
Views
0
Clicks
0
Like
0
Dislike