https://github.com/muniftanjim/is-mobile-phone-number-bd
Mobile phone number validator for Bangladesh
https://github.com/muniftanjim/is-mobile-phone-number-bd
bangladesh validator
Last synced: 7 months ago
JSON representation
Mobile phone number validator for Bangladesh
- Host: GitHub
- URL: https://github.com/muniftanjim/is-mobile-phone-number-bd
- Owner: MunifTanjim
- License: mit
- Created: 2019-04-15T23:24:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T05:26:52.000Z (almost 3 years ago)
- Last Synced: 2025-02-28T15:18:15.308Z (7 months ago)
- Topics: bangladesh, validator
- Language: TypeScript
- Size: 118 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# isMobilePhoneNumberBd
Mobile phone number validator for Bangladesh
## Usage
**CommonJS**
```js
const isMobilePhoneNumberBd = require('@muniftanjim/is-mobile-phone-number-bd').default
```**ES Module**
```js
import isMobilePhoneNumberBd from '@muniftanjim/is-mobile-phone-number-bd'
```### Validation
```js
isMobilePhoneNumberBd('+8801712345678') // true
isMobilePhoneNumberBd('8801712345678') // true
isMobilePhoneNumberBd('01712345678') // true
isMobilePhoneNumberBd('1712345678') // false
```### Validation w/ CountryCode
```js
const withCountryCode = true
isMobilePhoneNumberBd('+8801712345678', withCountryCode) // true
isMobilePhoneNumberBd('8801712345678', withCountryCode) // true
isMobilePhoneNumberBd('01712345678', withCountryCode) // false
isMobilePhoneNumberBd('1712345678', withCountryCode) // false
```### Validation w/o CountryCode
```js
const withCountryCode = false
isMobilePhoneNumberBd('+8801712345678', withCountryCode) // false
isMobilePhoneNumberBd('8801712345678', withCountryCode) // false
isMobilePhoneNumberBd('01712345678', withCountryCode) // false
isMobilePhoneNumberBd('1712345678', withCountryCode) // true
```