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

@devdataphone/sdk

v1.0.1

Published

Generate valid E.164 phone numbers for QA testing, database seeding, and mock data. Zero server-side retention.

Readme

@devdataphone/sdk

Generate valid E.164 phone numbers for QA testing, database seeding, and mock data. Zero server-side retention.

npm version License: MIT

🌐 Try it online: DevDataPhone.com - Free online phone number generator with no signup required.

Features

  • ✅ Generate valid E.164 format phone numbers
  • ✅ Support for 10+ countries (US, UK, CN, IN, AU, CA, DE, FR, JP, BR)
  • ✅ Validate phone numbers with detailed results
  • ✅ Format numbers to national, international, or E.164
  • ✅ Zero dependencies for core functionality
  • ✅ TypeScript support included
  • ✅ Works in Node.js 14+

Installation

npm install @devdataphone/sdk

Quick Start

const { generate, validate, format } = require('@devdataphone/sdk');

// Generate 10 US phone numbers
const numbers = generate({ region: 'US', count: 10 });
console.log(numbers[0].number); // +14155550123

// Validate a phone number
const result = validate('+8613912345678');
console.log(result.valid);      // true
console.log(result.country);    // China
console.log(result.countryCode); // CN

// Format a phone number
console.log(format('+14155550100', 'national'));      // (415) 555-0100
console.log(format('+14155550100', 'international')); // +1 415 555 0100

ESM Import

import { generate, validate, format } from '@devdataphone/sdk';

API Reference

generate(options)

Generate random phone numbers.

| Option | Type | Default | Description | |--------|------|---------|-------------| | region | string | 'US' | Country code (US, UK, CN, IN, AU, CA, DE, FR, JP, BR) | | count | number | 1 | Number of phone numbers (1-1000) | | format | string | 'e164' | Output format: 'e164', 'national', 'international', 'digits' |

const numbers = generate({ region: 'UK', count: 5 });
// Returns: [{ number: '+447700900123', national: '07700 900123', ... }]

generateOne(region, format)

Generate a single phone number string.

const number = generateOne('CN', 'national');
// Returns: '139 1234 5678'

validate(input, options)

Validate a phone number with detailed results.

const result = validate('+14155550100');
// Returns: { valid: true, country: 'United States', countryCode: 'US', type: 'FIXED_LINE_OR_MOBILE', ... }

isValid(input, defaultCountry)

Quick boolean validation check.

isValid('+14155550100');      // true
isValid('555-0100', 'US');    // true
isValid('invalid');           // false

isE164(input)

Check if input is valid E.164 format.

isE164('+14155550100');       // true
isE164('(415) 555-0100');     // false

format(input, style, options)

Format a phone number to different styles.

| Style | Example | |-------|---------| | 'e164' | +14155550100 | | 'national' | (415) 555-0100 | | 'international' | +1 415 555 0100 | | 'rfc3966' | tel:+1-415-555-0100 | | 'digits' | 14155550100 |

Convenience Formatters

toE164('+1 (415) 555-0100');        // +14155550100
toNational('+14155550100');          // (415) 555-0100
toInternational('+14155550100');     // +1 415 555 0100

Country Data

const { COUNTRIES, getCountry, getSupportedCountries, isSupported } = require('@devdataphone/sdk');

getSupportedCountries();  // ['US', 'UK', 'CN', 'IN', 'AU', 'CA', 'DE', 'FR', 'JP', 'BR']
isSupported('US');        // true
getCountry('US');         // { code: 'US', name: 'United States', dialCode: '+1', ... }

Supported Countries

| Code | Country | Dial Code | |------|---------|-----------| | US | United States | +1 | | UK | United Kingdom | +44 | | CN | China | +86 | | IN | India | +91 | | AU | Australia | +61 | | CA | Canada | +1 | | DE | Germany | +49 | | FR | France | +33 | | JP | Japan | +81 | | BR | Brazil | +55 |

Use Cases

  • QA Testing: Generate realistic phone numbers for automated tests
  • Database Seeding: Populate development databases with valid phone data
  • Mock Data: Create demo data for UI development
  • Form Testing: Test phone input validation without using real numbers

💡 Need a visual interface? Visit DevDataPhone.com for an instant online generator.

TypeScript

Full TypeScript definitions are included:

import { generate, validate, format, GenerateOptions, ValidationResult } from '@devdataphone/sdk';

const options: GenerateOptions = { region: 'US', count: 5 };
const numbers = generate(options);

const result: ValidationResult = validate('+14155550100');

Optional: Enhanced Validation with libphonenumber-js

For enhanced validation accuracy, optionally install libphonenumber-js:

npm install libphonenumber-js

The SDK will automatically use it if available.

Related Resources

License

MIT © DevDataPhone


DevDataPhone.com - Free Phone Number Generator for Developers