joi lets you describe data shapes in JavaScript and validate values against those schemas. It is installed as an npm package and documented on the joi.dev developer portal.
Overview
joi is a JavaScript library for defining schemas and checking that data matches them. You express rules in code, then run validation to accept or reject inputs such as request bodies, configuration objects, or parsed JSON.
The project is distributed through npm with a simple install command. Official tutorials, API documentation, and support resources are centralized on the joi.dev developer portal.
As a library rather than a standalone application, joi is meant to be imported into your own Node or JavaScript projects wherever structured validation is needed. It works as both a schema description language and a data validator for the JavaScript ecosystem.
It is commonly associated with the hapi ecosystem through its maintainers and topics, but the package itself focuses on reusable validation logic you embed in servers, CLIs, or other JavaScript code.
Key features
- Schema description language for JavaScript
- Data validation against defined schemas
- npm package distribution
- Documentation and tutorials on joi.dev
- Embeddable in application code
Use cases
- Validating HTTP request payloads
- Checking configuration before startup
- Asserting shape of parsed JSON data
- Sharing validation rules across JavaScript services
- Rejecting invalid user input early in code