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

zim-utils

v1.0.3

Published

A collection of utility functions specifically for Zimbabwean data formatting and validation.

Downloads

3

Readme

zim-utils

A collection of utility functions specifically for Zimbabwean data formatting and validation.

Features

  • Phone Number Formatting: Format Zimbabwean phone numbers to the international format.
  • Zimbabwean ID Validation: Validate Zimbabwean National ID numbers in the format XX-XXXXXXXXXX.

Installation

To install the zim-utils package, use npm:

npm install zim-utils

Usage

1. Phone Number Formatting

You can use the formatPhone function to format Zimbabwean phone numbers into the international format.

Function: formatPhone

import { formatPhone } from 'zim-utils';

const formattedNumber = formatPhone('0771234567');
console.log(formattedNumber); // Output: +263 77 123 4567

This function takes a Zimbabwean phone number (e.g., 0771234567) and returns it in the international format with a country code of +263.


2. Zimbabwean ID Validation

You can use the isValidZimID function to validate Zimbabwean National IDs.

Function: isValidZimID

import { isValidZimID } from 'zim-utils';

const id = '38-34343444R38';
console.log(isValidZimID(id)); // true

const invalidId = '38-34343444R3';
console.log(isValidZimID(invalidId)); // false

This function checks if a given Zimbabwean ID matches the expected format: XX-XXXXXXXXXX (two digits, followed by a hyphen, eight digits, one letter, and two digits at the end).


Functions Overview

formatPhone(phoneNumber: string): string

  • Description: Formats Zimbabwean phone numbers to the international format +263.
  • Arguments:
    • phoneNumber: A Zimbabwean phone number in the format 07xxxxxxxx.
  • Returns: A formatted phone number as a string in the international format.

isValidZimID(id: string): boolean

  • Description: Validates Zimbabwean National IDs with the format XX-XXXXXXXXXX.
  • Arguments:
    • id: A string representing the Zimbabwean ID in the format XX-XXXXXXXXXX.
  • Returns: true if the ID matches the format, false otherwise.

Example

Here’s a complete example that demonstrates both functions:

import { formatPhone, isValidZimID } from 'zim-utils';

// Format a Zimbabwean phone number
const formattedPhone = formatPhone('0771234567');
console.log(formattedPhone); // +263 77 123 4567

// Validate a Zimbabwean National ID
const zimId = '38-34343444R38';
const isValid = isValidZimID(zimId);
console.log(isValid); // true

const invalidZimId = '38-34343444R3';
console.log(isValidZimID(invalidZimId)); // false

Contribution

If you would like to contribute to this package, feel free to fork the repository, make your changes, and create a pull request. Any improvements or additions are welcome!


License

This package is licensed under the MIT License.