
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A collection of utility functions specifically for Zimbabwean data formatting and validation.
A collection of utility functions specifically for Zimbabwean data formatting and validation.
XX-XXXXXXXXXX.To install the zim-utils package, use npm:
npm install zim-utils
You can use the formatPhone function to format Zimbabwean phone numbers into the international format.
formatPhoneimport { 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.
You can use the isValidZimID function to validate Zimbabwean National IDs.
isValidZimIDimport { 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).
formatPhone(phoneNumber: string): string+263.phoneNumber: A Zimbabwean phone number in the format 07xxxxxxxx.isValidZimID(id: string): booleanXX-XXXXXXXXXX.id: A string representing the Zimbabwean ID in the format XX-XXXXXXXXXX.true if the ID matches the format, false otherwise.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
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!
This package is licensed under the MIT License.
FAQs
A collection of utility functions specifically for Zimbabwean data formatting and validation.
We found that zim-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.