For a lightweight validation library for JavaScript, the strongest matches are ianstormtaylor/superstruct (Superstruct is a robust, TypeScript-first library that provides schema-based), jquense/yup (Yup is a comprehensive, TypeScript-first schema validation library that) and colinhacks/zod (Zod is a comprehensive, TypeScript-first schema validation library that). hapijs/joi and open-circle/valibot round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
نحن نختار بعناية مستودعات GitHub مفتوحة المصدر التي تطابق “best javascript validation libraries”. النتائج مرتبة حسب صلتها ببحثك — استخدم الفلاتر أدناه للتضييق، أو قم بتحسين البحث باستخدام الذكاء الاصطناعي.
Superstruct is a JavaScript and TypeScript data validation library used to verify that data structures match defined shapes and types. It functions as a composable schema builder and a TypeScript schema validator, ensuring that runtime data checks remain synchronized with static type definitions. The library features a data coercion engine that transforms input values or injects default values before the validation process is executed. It enables the creation of complex validation rules by nesting, merging, or omitting properties from existing structures. Its capabilities cover the validatio
Superstruct is a robust, TypeScript-first library that provides schema-based validation, custom rules, and data coercion, making it a comprehensive solution for runtime data enforcement in both Node.js and browser environments.
Yup is a JavaScript schema validation library used to define data shapes and validate runtime values. It functions as an object schema validator and a data coercion engine, allowing developers to transform raw input values into desired types before performing validation checks. The library is distinguished by its support for dynamic schema validation, where rules can be adjusted at runtime based on sibling field values or external context. It also enables recursive data structuring for polymorphic fields and provides a system for extracting static TypeScript interfaces from runtime schema def
Yup is a comprehensive, TypeScript-first schema validation library that provides robust support for custom rules, asynchronous validation, and data transformation, making it a standard choice for enforcing data shapes in both browser and Node.js environments.
Zod is a TypeScript-first schema declaration and validation library designed to ensure end-to-end data integrity. It functions as a runtime type guard, allowing developers to define complex data structures through a declarative, chainable syntax. By using these schema definitions, the library automatically derives static TypeScript types, eliminating the need for manual type duplication and ensuring that runtime data matches expected application contracts. The library distinguishes itself through functional schema composition, which enables the creation of hierarchical structures by nesting a
Zod is a comprehensive, TypeScript-first schema validation library that provides robust runtime type checking, custom validation logic, and seamless integration across both browser and Node.js environments.
Joi is a JavaScript data validation library used to define schemas that validate, cast, and sanitize data objects. It functions as an object schema validator and parser, ensuring that input data matches specific types and formats before it is processed by an application. The library features a conditional validation engine capable of dynamic schema enforcement, where validation logic and dependencies change based on the values of other keys within an object. It also serves as a data casting and sanitization tool, transforming input values into target types and removing sensitive keys from the
Joi is a comprehensive, industry-standard schema validation library that provides robust support for custom rules, asynchronous validation, and data sanitization in both Node.js and browser environments.
Valibot is a modular, type-safe schema library for validating and parsing structural data in TypeScript environments.
Valibot is a modular, schema-based validation library that provides robust TypeScript support, runtime type inference, and extensive validation utilities for both browser and Node.js environments.
Ajv is a high-performance data validation framework that compiles JSON schemas into optimized, standalone JavaScript functions. By transforming declarative schema definitions into executable code, it eliminates runtime interpretation overhead and provides a secure, efficient way to enforce data integrity across both browser and server environments. The library distinguishes itself through its focus on performance and type safety. It employs advanced compilation techniques, including abstract syntax tree optimization and function caching, to ensure rapid validation. Beyond standard checks, it
Ajv is a high-performance, schema-based validation library that provides robust TypeScript support, asynchronous validation, and custom rule capabilities, making it a flagship tool for enforcing data integrity in both Node.js and browser environments.
Joi is a JavaScript data validation library used to define schemas that ensure the structure and data types of objects remain consistent. It functions as a schema-based validator and object schema definition tool, preventing invalid information from entering an application by checking data against predefined constraints and rules. The library employs a chainable fluent interface and a constraint-based validation engine to build complex validation pipelines. It utilizes recursive tree traversal to validate nested data structures and a type-coercion pipeline to transform input values into the t
Joi is a comprehensive, industry-standard schema validation library that provides a fluent API for defining complex constraints, full TypeScript support, and robust handling for both synchronous and asynchronous validation across Node.js and browser environments.
class-validator is a TypeScript class validation library that uses decorators to define constraints and rules for object properties. It functions as a decorator-based schema validator that ensures data integrity and structural correctness through a combination of synchronous checks and promise-based asynchronous rules. The library provides a recursive validation system for checking complex data hierarchies, including nested classes and individual elements within collections. It includes an object property whitelist utility capable of stripping undocumented properties or blocking unknown field
This library provides a robust, decorator-based approach to schema validation that fully supports TypeScript, asynchronous rules, and complex nested data structures in both Node.js and browser environments.
async-validator is a JavaScript schema validation library and asynchronous data validation engine. It verifies complex object structures and nested arrays by applying recursive rules and non-blocking, promise-based execution to ensure data integrity. The library functions as both an object constraint validator and a data transformation pipeline. It allows for the sanitization, coercion, and formatting of input values through a sequence of functions that run before and after the primary validation process. The engine covers a range of capabilities including recursive nested validation, the en
This library provides a robust, schema-based validation engine that supports asynchronous execution, custom rules, and TypeScript, making it a direct fit for enforcing data integrity in both browser and Node.js environments.
Validate.js is a JavaScript library designed for declarative data validation and form processing. It provides a framework for verifying complex objects and individual data points against structured constraint schemas, ensuring that application state and user input meet defined requirements. The library distinguishes itself through its support for asynchronous validation, allowing for verification tasks that require external data sources or server-side checks. It includes a built-in utility for extracting and normalizing data from web forms, which cleans input by removing whitespace and empty
Validate.js is a declarative schema-based validation library that supports asynchronous rules and works in both browser and Node.js environments, making it a solid choice for enforcing data integrity in JavaScript applications.
Arktype is a TypeScript runtime validation library and schema orchestrator. It synchronizes TypeScript types with runtime data validation, allowing users to define type-safe schemas that ensure unknown data adheres to specific structures during application execution. The project distinguishes itself by using set-theory type analysis to determine intersections and subtype compatibility, alongside JIT-compiled validation functions for optimized performance. It supports advanced type modeling through branded type constraints, recursive alias resolution, and the ability to generate runtime valida
Arktype is a high-performance, schema-based validation library that provides deep TypeScript integration and runtime type checking, making it a robust choice for enforcing data structures in both Node.js and browser environments.
v8n is a JavaScript data validation library used to verify that values, objects, and arrays meet specific criteria. It functions as a schema-based validator and an asynchronous validation engine, utilizing a fluent API to construct sequences of chainable rules and constraints. The framework is distinguished by its ability to execute promises and network requests during the validation process to determine if a value is valid. It allows for the creation of reusable validation schemas and provides a customizable rule framework where users can define their own logic and configure how error result
This library provides a fluent, schema-based validation engine that supports asynchronous rules, custom logic, and cross-environment compatibility, making it a solid choice for enforcing data integrity in JavaScript applications.
Parsley.js is a JavaScript form validation library that provides a client-side data validator for verifying input correctness before submission. It functions as an HTML attribute-based validator, allowing constraints to be defined declaratively within HTML data attributes to enforce rules without requiring custom scripts. The framework distinguishes itself through a customizable validation system that supports user-defined rules and custom error message templates. It includes a remote validation interface to verify form values against server endpoints via asynchronous network requests and sup
Parsley.js is a client-side form validation library that uses declarative HTML attributes to enforce rules, supporting custom validation logic and asynchronous remote verification for web forms.
Typia is a compile-time code generator that transforms TypeScript type annotations into runtime validation, serialization, and schema functions without requiring decorators or separate schema files. It generates optimized validation and serialization code during TypeScript compilation, producing dedicated functions for each type that eliminate runtime schema objects for faster execution. The project extends this core capability into several integrated areas. It generates fully typed client SDKs from NestJS controller source code, keeping server and client types synchronized automatically. It
Typia provides high-performance, schema-based validation by transforming TypeScript types into optimized runtime validation functions, making it a powerful tool for enforcing data integrity in both Node.js and browser environments.
Validator.js is a library of pure, stateless functions designed for the validation and sanitization of string data within any JavaScript environment. It provides a modular suite of tools to verify that user-provided information conforms to specific formats, such as emails, URLs, and dates, while simultaneously cleaning untrusted input to mitigate security risks. The library distinguishes itself through a design that avoids platform-specific APIs, ensuring consistent execution across browsers, servers, and edge runtimes. By utilizing a pre-compiled regular expression engine and a pure data tra
This library provides a robust, cross-platform suite of functions for string validation and sanitization, though it lacks the schema-based structure found in more modern object-validation frameworks.
Vuelidate is a model-based validation library for Vue.js applications. It functions as a client-side data validator and validation engine that decouples verification logic from the user interface by checking data models and state objects against defined rules. The system tracks field interactions and marks inputs as dirty to manage when validation messages are triggered. This approach allows the library to provide real-time user input feedback and verify model integrity before data is submitted. The framework covers form state validation, validation error rendering, and the configuration of
Vuelidate is a model-based validation library designed specifically for Vue.js applications, providing robust schema-like validation and TypeScript support, though it is more tightly coupled to UI state management than a generic, framework-agnostic validation library.
| المستودع | النجوم | اللغة | الترخيص | آخر تحديث |
|---|---|---|---|---|
| ianstormtaylor/superstruct | 7.1K | TypeScript | MIT | |
| jquense/yup | 23.7K | TypeScript | MIT | |
| colinhacks/zod | 43K | TypeScript | MIT | |
| hapijs/joi | 21.2K | JavaScript | NOASSERTION | |
| open-circle/valibot | 8.8K | TypeScript | MIT | |
| ajv-validator/ajv | 14.7K | TypeScript | MIT | |
| sideway/joi | 21.2K | JavaScript | NOASSERTION | |
| typestack/class-validator | 11.8K | TypeScript | MIT | |
| yiminghe/async-validator | 9.1K | TypeScript | MIT | |
| ansman/validate.js | 2.6K | JavaScript | MIT |