js-name-validator
v1.0.0
Published
Reusable name validation utility
Maintainers
Readme
@ashwath/name-validator
Simple and reusable name validation utility.
Install
npm install @ashwath/name-validator
Usage
import { validateName } from "@ashwath/name-validator";
const errors = validateName("test..name");
console.log(errors);Rules
- Must start with a letter
- No spaces allowed
- Supports letters, numbers, dot, underscore, hyphen
- No consecutive dots
- Length between 2–30 characters
