Skip to content

bd-phone-number-validator is a npm package designed to validate phone number of bangladesh. It can validates any Bangladeshi cell phone numbers and show all the information about the phone numbers operator.

MHNahib/bd-phone-number-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm i bd-phone-number-validator

npm npm

bd-phone-number-validator is a npm package designed to validate phone number of bangladesh. It can validates any Bangladeshi cell phone numbers and show all the information about the phone numbers operator.

Features

  • Can validae any Bangladeshi phone number (like +8801/8801/01).
  • Can find operator of the phone number.
  • Can return all the information of the phone number as object.

Components/ Objects

  • validate:

    • Takes phone number as input
    • Returns a boolean
      • true - if the number is valid
      • false - if not valid
  • operator:

    • Takes phone number as input
    • Returns an object
    • object contains:
    {
        phoneNumber: given phone number for validation',
        isValid: boolean,
        operator: operator name,
        operator_status: operator status
    }

How to install?

  npm i bd-phone-number-validator

Usage/Examples

const { validate, operator } = require("bd-phone-number-validator");

/* 
// operator returns an object 
// object contains: 
{
  phoneNumber: given phone number for validation',
  isValid: boolean,
  operator: operator name,
  operator_status: operator status
}
*/
console.log(operator(`01700000000`));

// validate returns a boolean
// true - if the number is valid
// false - if not valid
console.log(validate(`01000000000`));

Output

bd-phone-number-validator

🚀 Authors

@MHNahib

portfolio portfolio linkedin twitter

License

MIT

About

bd-phone-number-validator is a npm package designed to validate phone number of bangladesh. It can validates any Bangladeshi cell phone numbers and show all the information about the phone numbers operator.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published