Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@zene/mobile-number-validator
Advanced tools
A lightweight Javascript library for retrieving country information, including country codes, based on provided data. Simplify your application's logic by seamlessly integrating with this package to extract essential country details, facilitating tasks su
Readme
This npm library provides country data validation functionality, allowing you to retrieve data related to phone number lengths by country code.
You can install the library via npm:
npm install my-country-data-library
// Vanilla JS
const { getCountryDataByCode } = require('my-country-data-library');
// React usage
import { getCountryDataByCode } from '@zene/mobile-number-validator';
// Example usage:
const params = {
countryCode: string,
mobileNumber?: string,
internationalValidation?: boolean
}
const countryData = getCountryDataByCode(params);
console.log(countryData);
{
IsError: bool,
Message: 'string',
ReturnObj: {
country: 'string',
phLengthMax: int,
phLengthMin: int,
phExample: 'string',
validNumber?: 'string'
}
}
getCountryDataByCode({ countryCode: string|number, mobileNumber?: string, }): NumberValidationData
Parameter | Type | Description |
---|---|---|
countryCode | number or string | Required. The numeric country code for the desired country |
mobileNumber | string | Mobile number that needs to be verify |
internationalValidation | boolean | allows for an international dialing code to be in the number |
{
country: string;
phLengthMax: number |null;
phLengthMin: number | null;
phExample?: string | number;
validNumber?: string | null;
}
FAQs
A lightweight Javascript library for retrieving country information, including country codes, based on provided data. Simplify your application's logic by seamlessly integrating with this package to extract essential country details, facilitating tasks su
The npm package @zene/mobile-number-validator receives a total of 66 weekly downloads. As such, @zene/mobile-number-validator popularity was classified as not popular.
We found that @zene/mobile-number-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.