@ashishtwr/validator

returns a true or false based on certain checks for a string, helpful in form validations

Usage no npm install needed!

<script type="module">
  import ashishtwrValidator from 'https://cdn.skypack.dev/@ashishtwr/validator';
</script>

README

Form validator

Usage:

\

const validate = require("@ashishtwr/validator"); validate({ value: "Ashish Tiwari", max_len: 10, only_aplha: true })

All properties:

  1. value <String> : Pass the value to be validated
  2. max_len <Integer> : Maximum Length of the value allowed
  3. only_alpha <Boolean> : Checks for only alphabet characters
  4. only_num <Boolean> : Checks for only numeric characters
  5. space_allowed <Boolean> : Checks if space is allowed