Logo Lanfrica

andersonekechi/naija-validator

Domaine:

digital infrastructure

Type de record:

softwaretools
Créateur:
and
Hôte:
Validate Nigerian phone numbers, BVN, NIN, and bank accounts # Naija-Validator Validate Nigerian phone numbers, BVN, NIN, and bank account numbers. ```js const { phone, bvn, nin, bankAccount } = require('naija-validator'); phone('08031234567'); // { valid: true, network: 'MTN', formatted: '0803 123 4567' } phone('+234 803 123 4567'); // { valid: true, network: 'MTN', formatted: '0803 123 4567' } bvn('22212345678'); // { valid: true } nin('12345678901'); // { valid: true } bankAccount('0123456789', '058'); // { valid: true, bank: 'GTBank' } ``` ### Features - Validates with correct Nigerian prefixes (MTN, Glo, Airtel, 9mobile) - Detects network from number - Formats phone numbers - Clean input — handles spaces, dashes, country codes - Zero dependencies ### Why I built this Every Nigerian dev eventually needs to validate phone numbers and BVN. Most people copy-paste regex from StackOverflow. This is the correct, tested, maintained package. Built by Anderson Ekechi. Founder of BaceFlip.