Skip to content

Commit 60c8cf9

Browse files
authored
Update README with schema generation and error handling
Added a section for generating schema and error handling.
1 parent dae8fed commit 60c8cf9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ const users = await mockmate({
6464
});
6565
```
6666

67+
### Generate Schema
68+
69+
```ts
70+
const users = await generate({
71+
quantity: 3,
72+
schema: {
73+
id: () => crypto.randomUUID(),
74+
username: () => `user_${Math.random().toString(36).slice(2)}`,
75+
age: () => Math.floor(Math.random() * 50) + 18,
76+
email: () => "test@mail.com",
77+
},
78+
});
79+
```
80+
6781
### Error Handling
6882

6983
```ts

0 commit comments

Comments
 (0)