Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shivkanthb/validifyjs
☑️ Validations for node and the browser.
https://github.com/shivkanthb/validifyjs
browser form-validation npm regex validation
Last synced: 24 days ago
JSON representation
☑️ Validations for node and the browser.
- Host: GitHub
- URL: https://github.com/shivkanthb/validifyjs
- Owner: shivkanthb
- License: unlicense
- Created: 2016-12-09T21:33:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-25T23:41:31.000Z (almost 7 years ago)
- Last Synced: 2024-09-18T18:11:10.762Z (about 2 months ago)
- Topics: browser, form-validation, npm, regex, validation
- Language: JavaScript
- Homepage: https://shivkanthb.github.io/ValidifyJS
- Size: 455 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Validify JS
=========### Generic validation library in javascript
#### Can be used as both an npm module and also on the browser## Installation
### Node
```
npm install validifyjs
```### Browser
``````
## Usage
### Browser
Add html attribute "data-validify" to the element to be validated.
The value of the attribute would decide what validation is to be done.####Example:
This ensures email validation on this input field, by calling isEmail when submitting the form by calling validateForm(formElements).
Similary data-validify="html" maps to isHtml() method and so on.
Individual methods can also be called, and the regex patterns can also be overridden.####Override Regex Pattern:
isEmail("[email protected]") or isEmail("[email protected]", /(<([^>]+)>)/ig) (Although why use this particular regex is beyond me :P)### npm module
```
var validify = require('validifyjs')
```Individual methods and validateForm(formElements) can be called for validation, as mentioned in the case for the browser.
Other methods:
* isEmpty()
* isZipCode() (only for codes in the US)
* isMDDYYYYDate()
* isDDMMYYYYDate()
* is24HourTime()
* is12HourTime()
* isHtml()
* isHexColor()
* isUrl()
* isEmail()
* isNumber()
* isInteger()
* isPositive()
* isNegative()
* isIpv4()
* isIPv6()## Tests
```
npm test
```## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality. Lint and test your code.
## Release History
* 0.1.0 Initial release## Developers
* Hari
* Shivkanth