yiminghe/async-validator — explained in plain English
Analysis updated 2026-06-24
Validate form fields with rules for type, required status, length limits, and format patterns before submitting to a server.
Run async database checks to verify a username is unique without blocking the UI during the lookup.
Stack multiple validation rules on a single field and stop at the first failure to avoid unnecessary expensive queries.
| yiminghe/async-validator | wechat-article/wechat-article-exporter | betterdiscord/betterdiscord | |
|---|---|---|---|
| Stars | 9,099 | 9,089 | 9,071 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | writer | developer |
Figures from each repo's GitHub metadata at analysis time.
async-validator is a JavaScript library for checking whether data in a form or an object meets the rules you define before you accept it. You describe what each field should look like: its type, whether it is required, any length limits, or a specific pattern it must match. The library then checks the actual values and tells you which fields failed and why. What makes this library distinctive is that it handles checks that take time to complete, such as looking something up in a database to see if a username is already taken. Instead of freezing the page while waiting, it works in the background and finishes whenever the check resolves. You can use either a callback function or a Promise, depending on which style you prefer in your code. The rules you can define cover a wide range of common cases: string, number, boolean, email address, URL, date, integer, floating-point number, array, object, or a custom regular expression pattern. You can also mark a field as optional or required, set minimum and maximum lengths, check that a value belongs to a fixed list of allowed choices, or write a completely custom validation function when the built-in types are not enough. When multiple rules apply to a single field you can stack them in an array, and the library works through each in order. Options let you stop after the very first error found, either for the whole form or field by field, which is useful when you want to avoid running expensive database queries unnecessarily. The library is available as an npm package and is widely used as the validation engine inside popular component libraries for web applications. The README covers installation, all rule types, error message customization, and how to handle nested object and array structures.
A JavaScript and TypeScript library for validating form fields and data objects against defined rules, with built-in support for async checks like verifying a username is not already taken in a database.
Mainly TypeScript. The stack also includes TypeScript, JavaScript.
The explanation does not specify the license terms.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.