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 });
GET fakedata.data.user()

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

Click ▶ Run to generate a live response
GET fakedata.data.users(n)

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

Click ▶ Run to generate a live response
GET fakedata.data.creditcard()

data.creditcard()

Generates a realistic mock credit card profile. Not a real card — safe for UI testing and prototyping.

Live Response

Click ▶ Run to generate a live response
GET fakedata.data.get_email()

data.get_email()

Returns a single randomly generated email address with a realistic domain.

Live Response

Click ▶ Run to generate a live response
GET fakedata.data.get_city()

data.get_city()

Returns a random global city name from the bundled dataset.

Live Response

Click ▶ Run to generate a live response
GET fakedata.data.get_password(len)

data.get_password(len)

Generates a secure random password of specified length. Includes uppercase, lowercase, numbers, and symbols.

Live Response

Click ▶ Run to generate a live response
GET fakedata.data.userTimeSeries(options)

data.userTimeSeries()

Generates realistic chronological user activity logs, ideal for time-series modeling and event-driven architecture simulation.

Parameters

ParameterTypeDescription
daysintegerNumber of days to simulate (default: 30)
eventsPerDayintegerAverage events per day (default: 5)
FLAG anomaly_rate

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 });