aboutsummaryrefslogtreecommitdiff
path: root/docs/guide/index.md
blob: 46b41fbcfdb706269df39597009a0322897c3af5 (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
# Getting Started

## Overview

Faker is a popular library that generates fake (but reasonable) data that can be used for things such as:

- Unit Testing
- Performance Testing
- Building Demos
- Working without a completed backend

Faker was originally written in [Perl](https://metacpan.org/dist/Data-Faker) and this is the JavaScript port. Faker is also available as a library for [Ruby](https://github.com/faker-ruby/faker), [Java](https://github.com/DiUS/java-faker), and [Python](https://github.com/joke2k/faker).

This documentation only covers the JavaScript implementation of Faker.

## Environments

You can run Faker in the browser, or in Node.js. Faker v10.0 requires Node.js version 20 or above.

::: tip Note
When using CJS, you need to use at least Node.js v20.19. See https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require
:::

## Installation

Install it as a Dev Dependency using your favorite package manager.

::: code-group

```shell [npm]
npm install @faker-js/faker --save-dev
```

```shell [pnpm]
pnpm add @faker-js/faker --save-dev
```

```shell [yarn]
yarn add @faker-js/faker --dev
```

:::

## Faker Modules

Faker has three types of modules:

- Modules for basic datatypes: [`datatype`](/api/datatype), [`date`](/api/date), [`number`](/api/number) and [`string`](/api/string)
- Topic specific modules, such as [`animal`](/api/animal), [`food`](/api/food) and many more
- Lastly, the [`helpers`](/api/helpers) module, with various utility methods to use with your own data (or data generated by other Faker methods)

For a full list of modules, go to our [Api Search](/api/) page.

If you would like to know how to use Faker, go to our [Usage Guide](/guide/usage) page.

## Community

If you have questions or need help, reach out to the community via [Discord](https://chat.fakerjs.dev) and [GitHub Discussions](https://github.com/faker-js/faker/discussions).

You can see awesome things related to the Faker community at [Awesome Faker](https://github.com/faker-js/awesome-faker).