npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-naira-utils

v0.1.2

Published

Pure JS/TypeScript utilities for Nigerian React Native apps: Naira/kobo currency formatting, phone/network detection, USSD helpers, and NUBAN account number validation. Works with Expo (no native modules required).

Readme

react-native-naira-utils

CI

Pure JS/TypeScript utilities for Nigerian React Native apps: Naira/kobo currency formatting, phone/network detection, USSD helpers, and NUBAN account number validation.

No native modules required — works out of the box with Expo and bare React Native.

Install

npm install react-native-naira-utils

Usage

Currency

import { formatNaira, parseNaira, toKobo, fromKobo } from 'react-native-naira-utils';

formatNaira(1000);                          // "₦1,000.00"
formatNaira(1000, { showKobo: false });     // "₦1,000"
formatNaira(1250000, { abbreviate: true }); // "₦1.25m"
formatNaira(-500);                          // "-₦500.00"

parseNaira('₦1,200.50');                    // 1200.5

// For payment APIs (Paystack, Flutterwave, etc.) that require integer kobo:
toKobo(1200.5);   // 120050
fromKobo(120050); // 1200.5

Phone / network

import { isValidNGPhone, formatNGPhone, detectNetwork } from 'react-native-naira-utils';

isValidNGPhone('08031234567');    // true
isValidNGPhone('+2348031234567'); // true

formatNGPhone('+2348031234567');                            // "08031234567"
formatNGPhone('08031234567', { format: 'international' });  // "+2348031234567"

detectNetwork('08031234567'); // "MTN"

Note: detectNetwork is a best-effort heuristic based on original prefix allocations. Mobile Number Portability (MNP) means a number can be ported to a different network than its prefix suggests — don't rely on this for anything billing-critical.

USSD

import { buildUSSD, dialUSSD } from 'react-native-naira-utils';

const code = buildUSSD('737', ['1', '1']); // "*737*1*1#"
await dialUSSD(code); // opens the native dialer

Bank / NUBAN validation

import {
  isValidNUBAN,
  computeNUBANCheckDigit,
  isNUBANChecksumCompatible,
  getBankList,
} from 'react-native-naira-utils';

isValidNUBAN('0016563228', '058'); // true  (well-formed for GTBank)
isValidNUBAN('0016563229', '058'); // false (check digit mismatch)

computeNUBANCheckDigit('011', '000001457'); // 9

getBankList(); // ~40 Nigerian banks, MFBs, and fintechs with NIP codes

Note: NUBAN validation confirms an account number is mathematically well-formed, not that the account exists or belongs to a specific person. For real account verification, use an online resolve-account-number API (e.g. Paystack, Flutterwave).

The bundled list mixes classic 3-digit CBN sort codes (e.g. 058 for GTBank) with newer 5-6 digit NIP institution codes used by many microfinance banks and fintechs (e.g. 50211 for Kuda, 999992 for OPay). The CBN checksum algorithm only applies to 3-digit codes — use isNUBANChecksumCompatible(bank) to check before calling isValidNUBAN. For production, periodically re-sync the list against a live provider source rather than relying on this bundled snapshot indefinitely.

Why this exists

Every Nigerian fintech/e-commerce React Native app ends up hand-rolling Naira formatting, phone validation, USSD string building, and NUBAN checksum validation from scratch. This package centralizes those small but easy-to-get-wrong utilities in one dependency-light, Expo-friendly package.

License

MIT