You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-24Lines changed: 25 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
-
# Quick Mock Data Generator
1
+
# Quick Mock Data Generator
2
2
3
3
Need test data quickly? This lightweight utility helps you generate realistic mock data in seconds. Choose from common properties like names, emails, and dates, **or define your own generators**. Perfect for prototypes, tests, and demos where you need meaningful data fast.
4
4
5
5
Built on top of `@faker-js/faker`, it provides a simpler interface while maintaining type safety and full TypeScript support.
6
6
7
7
Key features:
8
+
8
9
- 🚀 Quick property selection from common data types
9
10
- 🎯 Generate exactly what you need, nothing more
10
11
- 📦 Zero configuration required
@@ -35,49 +36,49 @@ The `getMocksWith` function allows you to pick from a predefined set of common p
35
36
36
37
This basically returns a function that will create mock data based on a list of predefined properties.
37
38
38
-
39
39
```typescript
40
-
import { getMocksWith } from"@functions/mock";
40
+
import { getMocksWith } from'@functions/mock'
41
41
42
42
// Autosuggestion will let you pick the properties you want in your mock objects
The `getMocksFromGenerator` function lets you define your own data generation logic. You provide an object where each property is a function that generates values. You can mix and match:
52
+
52
53
- Faker.js functions
53
54
- Your own custom functions
54
55
- Random value generators
55
56
- Fixed value functions
56
57
- Any JavaScript/TypeScript function that returns a value
0 commit comments