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