@feedspub/validators
v0.0.8
Published
username, email and other validators for Feeds.pub
Readme
validators
A simple module(no dependency) to validate username, email and more for Feeds Pub.
Reusable on frontend and backend.
Install
npm install validatorsUsage
const { isEmail, isUsername, isPassword } = require('@feedspub/validators');
// true
isEmail('[email protected]');
isUsername('timqian');
isPassword('fidslde');Validating Rules
- email:
/\S+@\S+\.\S+/ - username:
/^[a-zA-Z0-9\-\_]+$/ - password:
length > 6
