Stringcheck is a small module to check strings against common Regexpatterns (like email address, numbers, etc). Stringcheck returns either the input if the input correctly formated or false. It provides the following methods:
- date
- url
- username
- password
- ipv4
- integer
- positiveInteger
- negativeInteger
- positiveOrNegativeNumber
- positiveNumber
- negativeNumber
- phoneNumber
- hex
- newLine
npm install stringcheck --save
let stringcheck = require('stringcheck');
let response = stringcheck.date('31.12.2016');
if(response !== null) { // The date is correctly formated. }
npm test
- 0.1.0 Initial release
Thanks to lukehass for the Regex expressions.