Back to Yaak

Yaak Faker Plugin

plugins-external/faker/README.md

2026.3.13.5 KB
Original Source

Yaak Faker Plugin

This is a template function that generates realistic fake data for testing and development using FakerJS.

Example JSON Body

Here's an example JSON body that uses fake data:

json
{
  "id": "${[ faker.string.uuid() ]}",
  "name": "${[ faker.person.fullName() ]}",
  "email": "${[ faker.internet.email() ]}",
  "phone": "${[ faker.phone.number() ]}",
  "address": {
    "street": "${[ faker.location.streetAddress() ]}",
    "city": "${[ faker.location.city() ]}",
    "country": "${[ faker.location.country() ]}",
    "zipCode": "${[ faker.location.zipCode() ]}"
  },
  "company": "${[ faker.company.name() ]}",
  "website": "${[ faker.internet.url() ]}"
}

This will generate a random JSON body on every request:

json
{
  "id": "589f0aec-7310-4bf2-81c4-0b1bb7f1c3c1",
  "name": "Lucy Gottlieb-Weissnat",
  "email": "[email protected]",
  "phone": "411.805.2871 x699",
  "address": {
    "street": "846 Christ Mills",
    "city": "Spencerfurt",
    "country": "United Kingdom",
    "zipCode": "20354"
  },
  "company": "Emard, Kohler and Rutherford",
  "website": "https://watery-detective.org"
}

Available Categories

The plugin provides access to all FakerJS modules and their methods:

CategoryDescriptionExample Methods
airlineAirline-related dataaircraftType, airline, airplane
animalAnimal names and typesbear, bird, cat, dog, fish
colorColors in various formatshuman, rgb, hex, hsl
commerceE-commerce datadepartment, product, price
companyCompany informationname, catchPhrase, bs
databaseDatabase-related datacolumn, type, collation
dateDate and time valuesrecent, future, past, between
financeFinancial dataaccount, amount, currency
gitGit-related databranch, commitEntry, commitSha
hackerTech/hacker terminologyabbreviation, noun, phrase
imageImage URLs and dataavatar, url, dataUri
internetInternet-related dataemail, url, ip, userAgent
locationGeographic datacity, country, latitude, longitude
loremLorem ipsum textword, sentence, paragraph
personPersonal informationfirstName, lastName, fullName
musicMusic-related datagenre, songName, artist
numberNumeric dataint, float, binary, hex
phonePhone numbersnumber, imei
scienceScientific datachemicalElement, unit
stringString utilitiesuuid, alpha, alphanumeric
systemSystem-related datafileName, mimeType, fileExt
vehicleVehicle informationvehicle, manufacturer, model
wordWord generationadjective, adverb, conjunction