File: first.md

package info (click to toggle)
node-chance 2.2.6%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,656 kB
  • sloc: javascript: 16,572; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 497 bytes parent folder | download | duplicates (2)
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
# first

```js
// usage
chance.first()
chance.first({ nationality: 'us' })
```

Generate a random first name

```js
Chance.first();
=> 'Leila'
```

Optionally specify a gender to limit first names to that gender

```js
Chance.first({ gender: "female" });
=> 'Emma'
```

Optionally specify a nationality to limit first names to those most common of that nationality

```js
Chance.first({ nationality: "it" });
=> 'Alberto'
```

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