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.
- 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.
-
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 }
npm i bd-phone-number-validator
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`));