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