Namespace: address

faker. address

Methods


<static> cardinalDirection(useAbbr)

cardinal direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> cardinalDirection(useAbbr)

cardinal direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> city(format)

Generates a random localized city name. The format string can contain any method provided by faker wrapped in {{}}, e.g. {{name.firstName}} in order to build the city name.

If no format string is provided one of the following is randomly used:

  • {{address.cityPrefix}} {{name.firstName}}{{address.citySuffix}}
  • {{address.cityPrefix}} {{name.firstName}}
  • {{name.firstName}}{{address.citySuffix}}
  • {{name.lastName}}{{address.citySuffix}}
Parameters:
Name Type Description
format String

<static> city(format)

Generates a random localized city name. The format string can contain any method provided by faker wrapped in {{}}, e.g. {{name.firstName}} in order to build the city name.

If no format string is provided one of the following is randomly used:

  • {{address.cityPrefix}} {{name.firstName}}{{address.citySuffix}}
  • {{address.cityPrefix}} {{name.firstName}}
  • {{name.firstName}}{{address.citySuffix}}
  • {{name.lastName}}{{address.citySuffix}}
Parameters:
Name Type Description
format String

<static> cityPrefix()

Return a random localized city prefix


<static> cityPrefix()

Return a random localized city prefix


<static> citySuffix()

Return a random localized city suffix


<static> citySuffix()

Return a random localized city suffix


<static> country()

country


<static> country()

country


<static> countryCode(alphaCode)

countryCode

Parameters:
Name Type Description
alphaCode string

default alpha-2


<static> countryCode(alphaCode)

countryCode

Parameters:
Name Type Description
alphaCode string

default alpha-2


<static> county()

county


<static> county()

county


<static> direction(useAbbr)

direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> direction(useAbbr)

direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> latitude(max, min, precision)

latitude

Parameters:
Name Type Description
max Double

default is 90

min Double

default is -90

precision number

default is 4


<static> latitude(max, min, precision)

latitude

Parameters:
Name Type Description
max Double

default is 90

min Double

default is -90

precision number

default is 4


<static> longitude(max, min, precision)

longitude

Parameters:
Name Type Description
max Double

default is 180

min Double

default is -180

precision number

default is 4


<static> longitude(max, min, precision)

longitude

Parameters:
Name Type Description
max Double

default is 180

min Double

default is -180

precision number

default is 4


<static> ordinalDirection(useAbbr)

ordinal direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> ordinalDirection(useAbbr)

ordinal direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> secondaryAddress()

secondaryAddress


<static> secondaryAddress()

secondaryAddress


<static> state(useAbbr)

state

Parameters:
Name Type Description
useAbbr Boolean

<static> state(useAbbr)

state

Parameters:
Name Type Description
useAbbr Boolean

<static> stateAbbr()

stateAbbr


<static> stateAbbr()

stateAbbr


<static> streetAddress(useFullAddress)

Returns a random localized street address

Parameters:
Name Type Description
useFullAddress Boolean

<static> streetAddress(useFullAddress)

Returns a random localized street address

Parameters:
Name Type Description
useFullAddress Boolean

<static> streetName()

Returns a random localized street name


<static> streetName()

Returns a random localized street name


<static> streetPrefix()

streetPrefix


<static> streetPrefix()

streetPrefix


<static> streetSuffix()

streetSuffix


<static> streetSuffix()

streetSuffix


<static> timeZone()

Return a random time zone


<static> timeZone()

Return a random time zone


<static> zipCode(format)

Generates random zipcode from format. If format is not specified, the locale's zip format is used.

Parameters:
Name Type Description
format String

<static> zipCode(format)

Generates random zipcode from format. If format is not specified, the locale's zip format is used.

Parameters:
Name Type Description
format String

<static> zipCodeByState(state)

Generates random zipcode from state abbreviation. If state abbreviation is not specified, a random zip code is generated according to the locale's zip format. Only works for locales with postcode_by_state definition. If a locale does not have a postcode_by_state definition, a random zip code is generated according to the locale's zip format.

Parameters:
Name Type Description
state String

<static> zipCodeByState(state)

Generates random zipcode from state abbreviation. If state abbreviation is not specified, a random zip code is generated according to the locale's zip format. Only works for locales with postcode_by_state definition. If a locale does not have a postcode_by_state definition, a random zip code is generated according to the locale's zip format.

Parameters:
Name Type Description
state String

Namespace: address

faker. address

Methods


<static> cardinalDirection(useAbbr)

cardinal direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> cardinalDirection(useAbbr)

cardinal direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> city(format)

Generates a random localized city name. The format string can contain any method provided by faker wrapped in {{}}, e.g. {{name.firstName}} in order to build the city name.

If no format string is provided one of the following is randomly used:

  • {{address.cityPrefix}} {{name.firstName}}{{address.citySuffix}}
  • {{address.cityPrefix}} {{name.firstName}}
  • {{name.firstName}}{{address.citySuffix}}
  • {{name.lastName}}{{address.citySuffix}}
Parameters:
Name Type Description
format String

<static> city(format)

Generates a random localized city name. The format string can contain any method provided by faker wrapped in {{}}, e.g. {{name.firstName}} in order to build the city name.

If no format string is provided one of the following is randomly used:

  • {{address.cityPrefix}} {{name.firstName}}{{address.citySuffix}}
  • {{address.cityPrefix}} {{name.firstName}}
  • {{name.firstName}}{{address.citySuffix}}
  • {{name.lastName}}{{address.citySuffix}}
Parameters:
Name Type Description
format String

<static> cityPrefix()

Return a random localized city prefix


<static> cityPrefix()

Return a random localized city prefix


<static> citySuffix()

Return a random localized city suffix


<static> citySuffix()

Return a random localized city suffix


<static> country()

country


<static> country()

country


<static> countryCode(alphaCode)

countryCode

Parameters:
Name Type Description
alphaCode string

default alpha-2


<static> countryCode(alphaCode)

countryCode

Parameters:
Name Type Description
alphaCode string

default alpha-2


<static> county()

county


<static> county()

county


<static> direction(useAbbr)

direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> direction(useAbbr)

direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> latitude(max, min, precision)

latitude

Parameters:
Name Type Description
max Double

default is 90

min Double

default is -90

precision number

default is 4


<static> latitude(max, min, precision)

latitude

Parameters:
Name Type Description
max Double

default is 90

min Double

default is -90

precision number

default is 4


<static> longitude(max, min, precision)

longitude

Parameters:
Name Type Description
max Double

default is 180

min Double

default is -180

precision number

default is 4


<static> longitude(max, min, precision)

longitude

Parameters:
Name Type Description
max Double

default is 180

min Double

default is -180

precision number

default is 4


<static> ordinalDirection(useAbbr)

ordinal direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> ordinalDirection(useAbbr)

ordinal direction

Parameters:
Name Type Description
useAbbr Boolean

return direction abbreviation. defaults to false


<static> secondaryAddress()

secondaryAddress


<static> secondaryAddress()

secondaryAddress


<static> state(useAbbr)

state

Parameters:
Name Type Description
useAbbr Boolean

<static> state(useAbbr)

state

Parameters:
Name Type Description
useAbbr Boolean

<static> stateAbbr()

stateAbbr


<static> stateAbbr()

stateAbbr


<static> streetAddress(useFullAddress)

Returns a random localized street address

Parameters:
Name Type Description
useFullAddress Boolean

<static> streetAddress(useFullAddress)

Returns a random localized street address

Parameters:
Name Type Description
useFullAddress Boolean

<static> streetName()

Returns a random localized street name


<static> streetName()

Returns a random localized street name


<static> streetPrefix()

streetPrefix


<static> streetPrefix()

streetPrefix


<static> streetSuffix()

streetSuffix


<static> streetSuffix()

streetSuffix


<static> timeZone()

Return a random time zone


<static> timeZone()

Return a random time zone


<static> zipCode(format)

Generates random zipcode from format. If format is not specified, the locale's zip format is used.

Parameters:
Name Type Description
format String

<static> zipCode(format)

Generates random zipcode from format. If format is not specified, the locale's zip format is used.

Parameters:
Name Type Description
format String

<static> zipCodeByState(state)

Generates random zipcode from state abbreviation. If state abbreviation is not specified, a random zip code is generated according to the locale's zip format. Only works for locales with postcode_by_state definition. If a locale does not have a postcode_by_state definition, a random zip code is generated according to the locale's zip format.

Parameters:
Name Type Description
state String

<static> zipCodeByState(state)

Generates random zipcode from state abbreviation. If state abbreviation is not specified, a random zip code is generated according to the locale's zip format. Only works for locales with postcode_by_state definition. If a locale does not have a postcode_by_state definition, a random zip code is generated according to the locale's zip format.

Parameters:
Name Type Description
state String