Modules@robinpath/phone

@robinpath/phone

0.1.1Public

Phone number parsing, formatting, validation, country detection, and comparison

@robinpath/phone

Phone number parsing, formatting, validation, country detection, and comparison

Category Functions Auth License

Why use this module?

The phone module lets you:

  • Parse phone number
  • Format phone in national format
  • Format to E.164
  • Format as international
  • Validate phone number

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/phone

Quick Start

No credentials needed — start using it right away:

phone.format "5551234567" "US"

Available Functions

FunctionDescription
phone.parseParse phone number
phone.formatFormat phone in national format
phone.formatE164Format to E.164
phone.formatInternationalFormat as international
phone.validateValidate phone number
phone.getCountryDetect country from phone
phone.getTypeGuess phone type
phone.normalizeStrip non-digits
phone.maskMask phone for display
phone.dialCodeGet dial code for country
phone.countryInfoGet country phone info
phone.listCountriesList supported countries
phone.compareCompare two phone numbers

Examples

Format phone in national format

phone.format "5551234567" "US"

Format to E.164

phone.formatE164 "5551234567"

Format as international

phone.formatInternational "5551234567"

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/phone";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  phone.format "5551234567" "US"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.1latestyesterday
Install
$ robinpath install @robinpath/phone
Version0.1.1
LicenseMIT
Unpacked Size5.2 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

utilities