# address
# zipCode([format])
Generates random zipcode. If format is not specified, the locale's zip format is used. Use formats that are supported with replaceSymbols
TIP
Param | Type | Default |
---|---|---|
format | string | undefined |
faker.address.zipCode(); // 98101-1234
faker.address.zipCode("#####"); // 98101
# zipCodeByState 5.0.0+
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.
faker.address.zipCodeByState(); // 12302
faker.address.zipCodeByState("wa"); // 98101
# city
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.
TIP
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}}
faker.address.city() // Lake Raoulfort
faker.address.city({{name.lastName}}{{address.citySuffix}}) // Powlowski port
# cityPrefix
Return a random localized city prefix
faker.address.cityPrefix(); // South
# citySuffix
Return a random localized city suffix
faker.address.citySuffix(); //burgh
# streetName
Returns a random localized street name
faker.address.streetName(); // Rowe Coves
# streetAddress([useFullAddress])
Returns a random localized street address. Pass in optional object boolean to get a full address.
TIP
Param | Type | Default |
---|---|---|
useFullAddress | boolean | false |
faker.address.streetAddress(); // 294 White Parkways
faker.address.streetAddress(true); // 294 White Parkways Apt. 506
# streetSuffix
Returns a random localized street suffix.
faker.address.streetSuffix(); // Garden
# streetPrefix
Returns a random localized street prefix.
faker.address.streetPrefix(); // c
# secondaryAddress
Returns a random Secondary Address
faker.address.secondaryAddress(); // Suite 123
# county
Returns a random county
faker.address.county(); // Cambridgeshire
# country
Returns a random country
faker.address.country(); // Papua New Guinea
# countryCode
Returns a random country code
faker.address.countryCode(); // SN
# state
Returns a random state
faker.address.state(); // Montana
# stateAbbr
Returns a random state abbreviation
faker.address.stateAbbr(); // WV
# latitude([max, min])
Returns a random latitude.
Params Available 5.0.0+
Param | Type | Default |
---|---|---|
max | number | 90 |
min | number | -90 |
faker.address.latitude(); // 78.9197
faker.address.latitude(70, 10); // 40.1239
# longitude([max, min])
Returns a random longitude.
Params Available 5.0.0+
Param | Type | Default |
---|---|---|
max | number | 180 |
min | number | -180 |
faker.address.longitude(); // 78.9197
faker.address.longitude(70, 10); // 40.1239