Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

validate_nigerian_phone

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

validate_nigerian_phone

A JS package to validate and format a Nigerian phone number as well as deduce the network provider or area code.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Nigerian Phone Number Validator (JS) HitCount

Issues and pull requests welcome.

A JS package to validate and format a Nigerian phone number as well as deduce the network provider or area code.

Table of Contents

Installation

You will need yarn and npm.

Install using npm: npm install validate_nigerian_phone Install using yarn: yarn add validate_nigerian_phone

Usage

const NigerianPhone = require('validate_nigerian_phone');
const phone = new NigerianPhone('+2348135087966');

// Check if is valid
phone.isValid(); // true

// Get formatted
phone.formatted(); // 08135087966

// Get Network
phone.getNetwork(); // mtn

// Check if is mtn
phone.isMtn(); // True


// Get network from phone number prefix e.g
phone.getNetworkByPrefix('0703'); // mtn

Features

Currently implemented

  • isValid
  • formatted
  • getNetwork
  • getAreaCode
  • isMtn
  • isGlo
  • isAirtel
  • is9mobile
  • isSmile
  • isMultilinks
  • isVisafone
  • isNtel
  • isStarcomms
  • isZoom
  • getPrefixesByNetwork
  • getNetworkByPrefix
  • getAreaCodeByName

Tests

Contribute

Check out the issues on GitHub and/or make a pull request to contribute!

Keywords

djunehor

FAQs

Package last updated on 10 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts