bd-phone-number-validator
v1.0.0
Published
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
Downloads
3
Maintainers
Readme
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`));