joi

The most powerful schema description language and data validator for JavaScript

Library
npm
v18.2.9
21,172 stars
Custom / Unknown

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
73 /100 Good
Development Activity 80
Maintenance 44
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 82
Code Quality 85
Innovation 78
Learning Curve 65

Joi is the flagship schema validation library from the hapi.js ecosystem, letting developers describe the exact shape, types, and constraints of JavaScript objects through a fluent, chainable API and then validate real data against that description. It has been a cornerstone of Node.js input validation since 2012, predating and inspiring much of the modern schema-validation landscape (Yup, Zod, and others openly cite Joi as an influence).

Beyond simple type-checking, Joi supports rich composition: conditional schemas, cross-field references, custom extensions, async validation, and detailed, localizable error messages. It ships first-class TypeScript types and a browser build, and remains under active maintenance by the hapi.js core team with a steady release cadence.

What You Get

  • A fluent, chainable schema-building API (Joi.object({...}), Joi.string(), Joi.number(), etc.) covering primitives, arrays, objects, dates, and binary data
  • Conditional validation (.when()), cross-field references (Joi.ref()), and custom extensions for domain-specific rules
  • Both synchronous .validate() and asynchronous .validateAsync() entry points, plus attempt() for throw-on-failure workflows
  • First-class TypeScript typings and a dedicated browser bundle (dist/joi-browser.min.js)
  • Detailed, customizable/localizable error messages with per-rule error codes

Common Use Cases

  • Validating REST/GraphQL API request bodies and query parameters at the edge of a Node.js service
  • Enforcing configuration file and environment variable shapes at application startup
  • Building reusable validation schemas shared between hapi.js route definitions and other frameworks
  • Sanitizing and coercing untrusted user input before it reaches business logic or a database layer

Under The Hood

Architecture - Joi’s core lives in lib/base.js, lib/validator.js, and lib/compile.js, which together implement an internal schema-object model (Any, extended by type-specific classes under lib/types/) that gets compiled into a validation plan and walked against input data. lib/ref.js and lib/template.js implement cross-field references and string interpolation for dynamic rules, while lib/errors.js centralizes structured error generation with per-rule codes, and lib/extend.js provides the public extension API for adding custom types.

Tech Stack - Written in vanilla JavaScript (97.5%) with a thin TypeScript typings layer (lib/index.d.ts), targeting Node.js >= 20. Runtime dependencies are all first-party @hapi/* utility packages (hoek, topo, formula, address, tlds, pinpoint) plus the @standard-schema/spec interop spec, keeping the dependency tree entirely within the hapi.js ecosystem’s own maintained packages.

Code Quality - The test/ directory mirrors lib/ file-for-file with deep coverage (thousands of assertions across base.js, validator.js, each type module), run via @hapi/lab. The project uses @hapi/eslint-plugin for consistent style enforcement and maintains a legacy-compatibility test (@hapi/joi-legacy-test) to catch breaking changes against older major versions — a strong signal of deliberate API stability discipline.

API Design - The chainable builder pattern (Joi.object({name: Joi.string().required()})) reads close to natural language and is widely imitated by later validators. The 4500+ line API.md reference and dedicated joi.dev documentation portal make the large surface area (dozens of type-specific methods) navigable, though the sheer breadth of rules and options does introduce a real learning curve for newcomers wanting more than basic type validation.

Used by 14 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
JavaScript
95%
MIT

AnythingLLM

AI Assistants · Automation · Developer Tools

66,533

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
90
Repo Health
78
Technical
64
Dependency
Built with
JavaScript 95%
Updated 1 weeks ago
TypeScript
49%
MPL 2.0

Artillery

Developer Tools · Devops

9,083

Cloud-scale load testing and functional testing for APIs, WebSockets, gRPC, and headless browsers, distributed across AWS Lambda or Fargate with zero infrastructure to manage.

View details
89
Repo Health
73
Technical
68
Dependency
Built with
TypeScript 49%
JavaScript 48%
Updated 1 weeks ago
TypeScript
70%
Other

Budibase

Low Code Platforms · No Code Platforms

28,324

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
91
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 70%
Svelte 26%
Updated 1 weeks ago
TypeScript
98%
AGPL 3.0

Checkmate

Analytics · Devops · Monitoring

10,895

Self-hosted uptime and infrastructure monitoring with multi-protocol checks, global geo-coverage, and beautiful real-time dashboards.

View details
90
Repo Health
82
Technical
67
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
TypeScript
79%
Other

Directus

CMS · Low Code Platforms

37,987

Connect any SQL database and get instant REST and GraphQL APIs, a visual management Studio, and a native MCP server for AI agents — free for most organizations.

View details
92
Repo Health
82
Technical
76
Dependency
Built with
TypeScript 79%
Vue 19%
Updated 1 weeks ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,301

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 98%
Updated 5 days ago
Rust
78%
AGPL 3.0

Lemmy

Community · Social Media

14,614

Federated, self-hosted Reddit alternative with full community ownership and no corporate control.

View details
89
Repo Health
74
Technical
62
Dependency
Built with
Rust 78%
PLpgSQL 14%
Updated 1 weeks ago
JavaScript
43%
Other

LimeSurvey

Forms Surveys

3,736

The world's most flexible open-source survey platform with 900+ templates, conditional logic, 80+ languages, and full GDPR compliance for any scale.

View details
86
Repo Health
62
Technical
63
Dependency
Built with
JavaScript 43%
PHP 35%
CSS 12%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers