Phone
Module to generate phone-related data.
Overview
For a phone number, use number()
. Many locales provide country-specific formats.
imei
Generates IMEI number.
Available since v6.2.0
Returns: string
ts
function imei(): string;
Examples
ts
faker.phone.imei() // '57-654648-937559-8'
Source
number
Generates a random phone number.
Available since v7.3.0
Parameters
Name | Type | Default | Description |
---|---|---|---|
options | { ... } | {} | Options object |
options.style? | 'human' | 'national' | 'international' | 'human' | Style of the generated phone number:
|
Returns: string
ts
function number(
options: {
style?: 'human' | 'national' | 'international';
} = {}
): string;
Examples
ts
faker.phone.number() // '765-564-8937 x5590'
faker.phone.number({ style: 'human' }) // '(287) 897-4716'
faker.phone.number({ style: 'national' }) // '(395) 527-4506'
faker.phone.number({ style: 'international' }) // '+16697346066'