Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A fast minimal module to validate Nigerian mobile phone numbers using Regular Expressions.

NotificationsYou must be signed in to change notification settings

dokasto/naija-phone-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm versionBuild Status

Naija Phone Number

A fast minimal module to validate Nigerian mobile phone numbers using Regular Expressions.

Installation

$ npm install naija-phone-number --save

Usage

This module assumes that you already know that Nigerian numbersare prefixed by+234 and you should not expect your users to type that. Instead your UI should look something like this.

     |**********************|+234 |  phone number here   |     |**********************|

Now that we've gotten this out of the way here's an example

constnaijaNumber=require('naija-phone-number');letphoneInput=document.querySelector('#phone-input').value;naijaNumber.isValid(phoneInput);// true or false

Also

// 12 digit numbersnaijaNumber.isValid('070328582392');// true// pass argument as NumbernaijaNumber.isValid(081928582392);// true// Unknown providernaijaNumber.isValid(050728582392);// false

License

MIT

About

A fast minimal module to validate Nigerian mobile phone numbers using Regular Expressions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp