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() // '13-850175-913761-7'
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() // '961-770-7727'
faker.phone.number({ style: 'human' }) // '555.770.7727 x1234'
faker.phone.number({ style: 'national' }) // '(961) 770-7727'
faker.phone.number({ style: 'international' }) // '+15551234567'