summaryrefslogtreecommitdiff
path: root/src/node_modules/chance/docs/person/name.md
blob: 46ae9e9f7caca9aeb73cdf0151cf732cd596f136 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# name

```js
// usage
chance.name()
chance.name({ middle: true })
chance.name({ middle_initial: true })
chance.name({ prefix: true })
chance.name({ nationality: 'en' })
```

Generate a random name

```js
  chance.name();
  => 'Dafi Vatemi'
```

Optionally include the middle name

```js
  chance.name({ middle: true });
  => 'Nelgatwu Powuku Heup'
```


Optionally include the middle initial

```js
  chance.name({ middle_initial: true });
  => 'Ezme I Iza'
```

Optionally include the prefix

```js
  chance.name({ prefix: true });
  => 'Doctor Suosat Am'
```

Optionally include the suffix

```js
  chance.name({ suffix: true });
  => 'Fanny Baker Esq.'
```

Optionally specify a gender

```js
  chance.name({ gender: 'male' });
  => "Patrick Copeland"
```

Optionally specify a nationality

```js
  chance.name({ nationality: 'it' });
  => "Roberta Mazzetti"
```

Note, currently support for nationality is limited to: `'en', 'it'`.