location Domain
The location domain maps domain keywords to underlying faker implementations.
Faker Documentation
Methods
location.buildingNumber
Generates a random building number.
- Canonical:
awd.domain.location.buildingNumber - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.buildingNumber()
Example return values:
"5098""8232"
location.cardinalDirection
Returns a random cardinal direction (north, east, south, west).
- Canonical:
awd.domain.location.cardinalDirection - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.cardinalDirection()
Example return values:
"West"
location.city
Generates a random localized city name.
- Canonical:
awd.domain.location.city - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.city()
Example return values:
"Neldachester""East Libbychester"
location.continent
Returns a random continent name.
- Canonical:
awd.domain.location.continent - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.continent()
Example return values:
"Antarctica""Asia"
location.country
Returns a random country name.
- Canonical:
awd.domain.location.country - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.country()
Example return values:
"Indonesia""Iraq"
location.countryCode
Returns a random ISO_3166-1 country code.
- Canonical:
awd.domain.location.countryCode - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.countryCode()
Example return values:
"PE""KI"
location.county
Returns a random localized county, or other equivalent second-level administrative entity for the locale's country such as a district or department.
- Canonical:
awd.domain.location.county - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.county()
Example return values:
"Rutland""Washington County"
location.direction
Returns a random direction (cardinal and ordinal; northwest, east, etc).
- Canonical:
awd.domain.location.direction - Faker docs: https://fakerjs.dev/api/location
| Arg | Type | Required | Description |
|---|---|---|---|
abbreviated | boolean | no | If true this will return abbreviated directions (NW, E, etc). Otherwise this will return the long name. |
Examples:
location.direction()
location.direction(abbreviated=false)
Example return values:
"East""North"
location.language
Returns a random spoken language.
- Canonical:
awd.domain.location.language - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.language()
Example return values:
{"name":"Tagalog","alpha2":"tl","alpha3":"tgl"}{"name":"Azerbaijani","alpha2":"az","alpha3":"aze"}
location.latitude
Generates a random latitude.
- Canonical:
awd.domain.location.latitude - Faker docs: https://fakerjs.dev/api/location
| Arg | Type | Required | Description |
|---|---|---|---|
min | number | no | The lower bound for the latitude to generate. |
max | number | no | The upper bound for the latitude to generate. |
precision | number | no | The number of decimal points of precision for the latitude. |
Examples:
location.latitude()
location.latitude(min=1, max=1, precision=1)
Example return values:
38.589357.5593
location.longitude
Generates a random longitude.
- Canonical:
awd.domain.location.longitude - Faker docs: https://fakerjs.dev/api/location
| Arg | Type | Required | Description |
|---|---|---|---|
min | number | no | The lower bound for the longitude to generate. |
max | number | no | The upper bound for the longitude to generate. |
precision | number | no | The number of decimal points of precision for the longitude. |
Examples:
location.longitude()
location.longitude(min=1, max=1, precision=1)
Example return values:
-174.1417100.7973
location.nearbyGPSCoordinate
Generates a random GPS coordinate within the specified radius from the given coordinate.
- Canonical:
awd.domain.location.nearbyGPSCoordinate - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.nearbyGPSCoordinate()
Example return values:
[-5.738,-37.5877][30.3643,59.1147]
location.ordinalDirection
Returns a random ordinal direction (northwest, southeast, etc).
- Canonical:
awd.domain.location.ordinalDirection - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.ordinalDirection()
Example return values:
"Southwest""Southeast"
location.secondaryAddress
Generates a random localized secondary address. This refers to a specific location at a given address
- Canonical:
awd.domain.location.secondaryAddress - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.secondaryAddress()
Example return values:
"Suite 588""Apt. 105"
location.state
Returns a random localized state, or other equivalent first-level administrative entity for the locale's country such as a province or region.
- Canonical:
awd.domain.location.state - Faker docs: https://fakerjs.dev/api/location
| Arg | Type | Required | Description |
|---|---|---|---|
abbreviated | boolean | no | If true this will return abbreviated first-level administrative entity names. Otherwise this will return the long name. |
Examples:
location.state()
location.state(abbreviated=false)
Example return values:
"New Hampshire""Louisiana"
location.street
Generates a random localized street name.
- Canonical:
awd.domain.location.street - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.street()
Example return values:
"Kemmer Forges""Labadie Extension"
location.streetAddress
Generates a random localized street address.
- Canonical:
awd.domain.location.streetAddress - Faker docs: https://fakerjs.dev/api/location
| Arg | Type | Required | Description |
|---|---|---|---|
useFullAddress | boolean | no | When true, generates a fuller address variant (for example including additional address detail). When false or omitted, generates a standard street address. |
Examples:
location.streetAddress()
location.streetAddress(useFullAddress=true)
Example return values:
"24973 Steuber Skyway""555 Kali Summit"
location.timeZone
Returns a random IANA time zone name.
- Canonical:
awd.domain.location.timeZone - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.timeZone()
Example return values:
"America/Anchorage""Asia/Pyongyang"
location.zipCode
Generates data using faker location zip code.
- Canonical:
awd.domain.location.zipCode - Faker docs: https://fakerjs.dev/api/location
No parameters.
Examples:
location.zipCode()
Example return values:
"24867""55040-0535"