Introduction
fakedata provides a structured, consistent API for generating synthetic data. Zero external dependencies. Same structure across Node.js and Python.
Zero Dependencies
No external packages required. Bundles all data as local JSON files.
Consistent API
Same method names and return schemas in both Node.js and Python.
Instant Results
Data is pre-loaded into memory. Generation is effectively O(1).
MIT License
Free to use in commercial and open-source projects.
Quick Start
const fakedata = require('@abhay557/fakedata'); // Generate a full user const user = fakedata.data.user(); // Time-series & anomalies const ts = fakedata.data.userTimeSeries({ days: 30 });
data.user()
Generates a single, comprehensive mock user profile including personal details, address, employment, and banking information.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| — | — | No | No parameters required. |
Response Schema
{
"fullName": string,
"email": string,
"phone": string,
"address": {
"street": string,
"city": string,
"zip": string
},
"job": {
"title": string,
"company": string
},
"creditCard": {
"type": string,
"number": string,
"expiry": string,
"cvv": string
}
}
Live Response
data.users(n)
Generates an array of n unique mock user profiles. Ideal for seeding databases or populating paginated tables.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
n |
integer | Yes | Number of user profiles to generate. |
Live Response
data.creditcard()
Generates a realistic mock credit card profile. Not a real card — safe for UI testing and prototyping.
Live Response
data.get_email()
Returns a single randomly generated email address with a realistic domain.
Live Response
data.get_city()
Returns a random global city name from the bundled dataset.
Live Response
data.get_password(len)
Generates a secure random password of specified length. Includes uppercase, lowercase, numbers, and symbols.
Live Response
data.userTimeSeries()
Generates realistic chronological user activity logs, ideal for time-series modeling and event-driven architecture simulation.
Parameters
| Parameter | Type | Description |
|---|---|---|
days | integer | Number of days to simulate (default: 30) |
eventsPerDay | integer | Average events per day (default: 5) |
Anomaly Injection
By passing anomaly_rate: 0.1 to data.users(), the engine injects statistically unlikely fraud patterns into 10% of the returned user profiles.
const users = fakedata.data.users(100, { anomaly_rate: 0.05 });