# checkit **Repository Path**: mirrors_davisjam/checkit ## Basic Information - **Project Name**: checkit - **Description**: simple, flexible validations for node and the browser - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Checkit.js A DOM-independent validation library for **Node.js**, **io.js** and the **browser**. It supports both sync It allows you to seamlessly validate full javascript objects, defining custom messages, labels, and validations, with full support for asynchronous validations with promises. It supports [conditional validations](#conditional-validations), and has powerful, consistent [error structuring](#checkit-errors) and [utility methods](#error-utility-methods) for manipulating your errors' output any way you can imagine. ```js var mainRules = Checkit(rules); mainRules .run(obj) .then(function(validatedFields) { console.log('The fields: ' + _.keys(validatedFields).join(', ') + ' were validated!'); }) .caught(Checkit.Error, function(err) { $("#errors").html(err.map(function(val, key) { return '
| Validation Name | Description |
|---|---|
| accepted | The value must be yes, on, or 1. This is useful for validating "Terms of Service" acceptance. |
| alpha | The value must be entirely alphabetic characters. |
| alphaDash | The value may have alpha-numeric characters, as well as dashes and underscores. |
| alphaNumeric | The value must be entirely alpha-numeric characters. |
| alphaUnderscore | The value must be entirely alpha-numeric, with underscores but not dashes. |
| arguments | The value must be a javascript "arguments" object. |
| array | The value must be a valid array object. |
| base64 | The value must be a base64 encoded value. |
| between:min:max | The value must have a size between the given min and max. |
| boolean | The value must be a javascript boolean. |
| contains:value | The value must contain the value. For a string, it does an "indexOf" check, an array "_.indexOf" and for an object "_.has". | date | The value must be a valid date object. |
| different:fieldName | The given field must be different than the `fieldName` under validation. |
| The field must be a valid formatted e-mail address. | |
| empty | The value under validation must be empty; either an empty string, an empty, array, empty object, or a falsy value. |
| exactLength:value | The field must have the exact length of "val". |
| exists | The value under validation must not be undefined. |
| finite | The value under validation must be a finite number. |
| function | The value under validation must be a function. |
| greaterThan:value | The value under validation must be "greater than" the given value. |
| greaterThanEqualTo:value | The value under validation must be "greater than" or "equal to" the given value. |
| integer | The value must have an integer value. |
| ipv4 | The value must be formatted as an IPv4 address. |
| ipv6 | The value must be formatted as an IPv6 address. |
| lessThan:value | The value must be "less than" the specified value. |
| lessThanEqualTo:value | The value must be "less than" or "equal to" the specified value. |
| luhn | The given value must pass a basic luhn (credit card) check regular expression. |
| matchesField:fieldName | The value must exactly match the value of another `fieldName` under validation. |
| max:value | The value must be less than a maximum value. Strings, numerics, and files are evaluated in the same fashion as the size rule. |
| maxLength:value | The value must have a length property which is less than or equal to the specified value. Note, this may be used with both arrays and strings. |
| min:value | The value must have a minimum value. Strings, numerics, and files are evaluated in the same fashion as the size rule. |
| minLength:value | The value must have a length property which is greater than or equal to the specified value. Note, this may be used with both arrays and strings. |
| NaN | The value must be NaN. |
| natural | The value must be a natural number (a number greater than or equal to 0). |
| naturalNonZero | The value must be a natural number, greater than or equal to 1. |
| null | The value must be null. |
| number | The value must be a javascript Number. |
| numeric | The value must have a numeric value. |
| object | The value must pass an _.isObject check. |
| plainObject | The value must be an object literal. |
| regExp | The value must be a javascript RegExp object. |
| required | The value must be present in the input data. |
| string | The value must be a string type. |
| url | The value must be formatted as an URL. |
| uuid | Passes for a validly formatted UUID. |