joi README

The project's README from github.com/hapijs/joi. As one markdown file: README.md.

joi

The most powerful schema description language and data validator for JavaScript.

Installation

npm install joi

Visit the joi.dev Developer Portal for tutorials, documentation, and support

Useful resources

joi (hapijs/joi)

Searching Database…

21.2K ·GitHub
What is this?joi is a schema description language and data validator for JavaScript: you describe what valid data looks like, and joi checks objects against that description. It comes from the hapi ecosystem but works in any JavaScript project.
Is it a framework I run, or a library I call from my own code?A library — you install it with npm and call it from your code to validate data. There is no server or process to run.
How do I add it to a project?npm install joi is all it takes. For tutorials, the full API reference and support, the project points to the joi.dev Developer Portal.
Do I need a recent Node version to use it?Yes — the package declares Node.js 20 as its minimum, so older Node installs are out. Nothing else is needed: no Python, no compilers, no Docker.
Is joi tied to the hapi framework, or can I use it anywhere?Anywhere — it is an independent npm package and nothing in it requires the hapi server. The hapi tie is its origin: internals are built on small @hapi utility modules like @hapi/hoek.
Does joi work in the browser, or is it Node-only?Both. It runs on Node.js and the repo maintains a separate browser build that gets compiled before each publish, so the same validation logic can run client-side too.
What does the Standard Schema support give me?joi ships @standard-schema/spec as a dependency — that is the Standard Schema interface, the common way for JS libraries to expose validators. It means joi plays well with tools that accept Standard Schema validators without custom adapters.
Does it drag a lot of dependencies into my project?No — the runtime footprint is six small @hapi helpers (@hapi/hoek, @hapi/topo, @hapi/formula, @hapi/address, @hapi/pinpoint, @hapi/tlds) plus the Standard Schema spec. No Docker, Python or native compilation involved.
Is joi still maintained, or is it a legacy project?It looks alive and well guarded: the repo is not archived, CI workflows run on changes, and the test suite executes with a strict 100% coverage threshold via @hapi/lab. The project has existed since 2012.
Creator
hapijs
Size
9.9 MB
Stars
21.2K
Updated
CommitSep 11
Age
14y
Commits · 90 Days