A blazing-fast JavaScript validation library for Node.js, browsers, and Deno with 24 built-in validators and sanitizations.
fastest-validator is a high-performance JavaScript validation library that compiles schemas into optimized functions for runtime validation. It solves the problem of slow validation in applications by providing a fast, flexible, and feature-rich alternative to libraries like Joi, with support for Node.js, browsers, and Deno.
JavaScript developers building applications that require robust data validation, such as API servers, form handlers, or data processing pipelines, where performance is critical.
Developers choose fastest-validator for its exceptional speed—up to 50x faster than Joi—combined with a comprehensive set of built-in validators, sanitizations, and extensibility through custom validators and async support.
:zap: The fastest JS validator library for NodeJS
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Compiles validation schemas into optimized JavaScript functions, achieving speeds up to 8 million validations per second—up to 50x faster than Joi, as benchmarked in the README.
Includes 24 built-in validators covering common types like string, number, date, email, UUID, and more, reducing the need for custom code for standard use cases.
Provides sanitizers for default values, trimming, case conversion, and type coercion, allowing data normalization during validation without extra libraries.
Supports custom validators, aliases, and asynchronous validation for checks like database lookups, offering flexibility for complex or remote validation scenarios.
Initial schema compilation uses the Function constructor, which can add setup time and might raise security concerns in restricted environments, though the README clarifies it's safe as no user input is involved.
Schema definitions can be more verbose compared to libraries like Joi, especially for nested objects, potentially increasing code bulk and maintenance effort.
While it has native support for Moleculer and plugins for Fastify and Express, it lacks the extensive ecosystem and third-party integrations of more established alternatives like Joi.
fastest-validator is an open-source alternative to the following products: