Skip to content

Commit

Permalink
Add simple faker usage docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Sep 13, 2023
1 parent 2455a46 commit 845f329
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/guide/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ or alternatively you can set a default reference date for all these methods:
faker.setDefaultRefDate('2023-01-01T00:00:00.000Z');
```

## Simple data generation

Faker provides a `simpleFaker` that can be used to generate data that are not based on any locales like numbers and strings.
Also **helpers** like `arrayElement` or `multiple` are available.

This is useful if you just want to generate e.g. `uuid`s for your production environment, but don't want to initiate/load a full Faker instance, which would include locale data.

```ts
import { simpleFaker } from '@faker-js/faker';

const uuid = simpleFaker.string.uuid();
```

## Create complex objects

Faker mostly generates values for primitives.
Expand Down

0 comments on commit 845f329

Please sign in to comment.