A simple, stateless JavaScript validation library for Node.js and Express, built on validator.js.
Property-validator is a validation library for JavaScript, Node.js, and Express that simplifies checking request parameters, query strings, bodies, and headers. It provides a suite of `validate` and `assert` functions built on validator.js, enabling developers to define validation rules declaratively without complex chaining or prototype modifications.
Node.js and Express developers who need a straightforward, stateless way to validate incoming HTTP request data in their web applications.
Developers choose property-validator for its simplicity, extensibility, and seamless integration with Express middleware, offering a clean alternative to more complex validation libraries with minimal overhead.
:white_check_mark: Easy property validation for JavaScript, Node and Express.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides dedicated functions like validateBody and assertParams for easy request validation in Express middleware, with examples for params, query, body, and headers.
Ships with built-in TypeScript definitions, ensuring type safety without additional installations, as noted in the README.
Allows writing custom validation functions and setting localized error messages, demonstrated in the advanced usage section with optional fields and custom messages.
Built on validator.js with a stateless, functional approach that avoids chaining or prototype violations, keeping the API straightforward and minimal.
The README explicitly lists numerous validator.js helpers as 'not currently supported', such as isAfter and isMobilePhone, limiting out-of-the-box functionality for advanced validation needs.
While usable in Node.js generally, its primary functions are tailored for Express request validation, making integration with other frameworks like Koa more cumbersome.
Focuses on individual field validation without built-in support for defining complex schemas or validating interdependent fields, which may require manual handling.