validate-telephone

Plugin Play function to validate telephone numbers

Usage no npm install needed!

<script type="module">
  import validateTelephone from 'https://cdn.skypack.dev/validate-telephone';
</script>

README

validate-telephone

Intro - Telehone Number validation


Simple Telephone number validation

List of features

  • Simple validation for telephone numbers
  • based on google-libphonenumber

Code Demo

import { ValidateTelephone, IValidateTelephoneResults } from "validate-telephone";

const region: string = "US";
const examplePhoneNumber: string = "202-100-0000";
const telephoneValidationResults: IValidateTelephoneResults = ValidateTelephone(examplePhoneNumber, region);
console.log(telephoneValidationResults.IsValid);
console.log(telephoneValidationResults.Message);

Download & Installation

$ npm i validate-telephone

Contributing

Authors or Acknowledgments

  • Idaho Edokpayi idaho_edokpayi@ios.doi.gov

License

This project is licensed under the MIT License