Validates Bangladeshi cell phone numbers.
- Install from
npm
:
npm install bd-cellnum-validator
const validator = require('bd-cellnum-validator');
var cellNumber = '1212121'
// validator.isValid returns a boolean
// true - if the number is valid
// false - if not valid
var result = validator.isValid(cellNumber);
console.log(result);
- Clone the repository from github
- Then open your favorite command shell inside the directory and run :
npm run test
isValid
function takes the cell number asString
as its param.- returns
true
if the cell number is valid andfalse
otherwise.
MIT