Skip to content

A simple module used to validate username, email, password and more for Feeds.Pub

License

Notifications You must be signed in to change notification settings

feedspub/validators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

validators

A simple module(no dependency) to validate username, email and more for Feeds Pub.

Reusable on frontend and backend.

Install

npm install validators

Usage

const { isEmail, isUsername, isPassword } = require('@feedspub/validators');

// true
isEmail('timqian@t9t.io');
isUsername('timqian');
isPassword('fidslde');

Validating Rules

  • email: /\S+@\S+\.\S+/
  • username: /^[a-zA-Z0-9\-\_]+$/
  • password: length > 6

About

A simple module used to validate username, email, password and more for Feeds.Pub

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published