Skip to content

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'

number

Generates a random phone number.

Available since v7.3.0

Parameters

NameTypeDefaultDescription
options{ ... }{}

Options object

options.style?'human' | 'national' | 'international''human'

Style of the generated phone number:

  • 'human': (default) A human-input phone number, e.g. 555-770-7727 or 555.770.7727 x1234
  • 'national': A phone number in a standardized national format, e.g. (555) 123-4567.
  • 'international': A phone number in the E.123 international format, e.g. +15551234567

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'

Released under the MIT License.