Generates a random full name.
Optional
options: { firstName?: string; lastName?: string; sex?: "female" | "male" }An options object.
Optional
firstName?: stringThe optional first name to use. If not specified a random one will be chosen.
Optional
lastName?: stringThe optional last name to use. If not specified a random one will be chosen.
Optional
sex?: "female" | "male"The optional sex to use. Can be either 'female'
or 'male'
.
faker.person.fullName() // 'Allen Brown'
faker.person.fullName({ firstName: 'Joann' }) // 'Joann Osinski'
faker.person.fullName({ firstName: 'Marcella', sex: 'female' }) // 'Mrs. Marcella Huels'
faker.person.fullName({ lastName: 'Beer' }) // 'Mr. Alfonso Beer'
faker.person.fullName({ sex: 'male' }) // 'Fernando Schaefer'
Returns a random sex.
Output of this method is localised, so it should not be used to fill the parameter sex
available in some other modules for example faker.person.firstName()
.
Returns a random sex type. The SexType
is intended to be used in parameters and conditions.
Module to generate people's personal information such as names and job titles. Prior to Faker 8.0.0, this module was known as
faker.name
.Overview
To generate a full name, use
fullName
. Note that this is not the same as simply concatenatingfirstName
andlastName
, as the full name may contain a prefix, suffix, or both. Additionally, different supported locales will have differing name patterns. For example, the last name may appear before the first name, or there may be a double or hyphenated first or last name.You can also generate the parts of a name separately, using
prefix
,firstName
,middleName
,lastName
, andsuffix
. Not all locales support all of these parts.Many of the methods in this module can optionally choose either female, male or mixed names.
Job-related data is also available. To generate a job title, use
jobTitle
.This module can also generate other personal information which might appear in user profiles, such as
gender
,zodiacSign
, andbio
.Related modules
For personal contact information like phone numbers and email addresses, see the
faker.phone
andfaker.internet
modules.