Documentation
Learn how to create powerful JSON templates with LiteMock
Quick Start
Create JSON templates using our simple syntax. Variables start with @
and follow the pattern @category.method
{
"name": @person.firstName,
"email": @internet.email,
"age": @number.int(18, 65)
}
š Faker.js Integration
Use any faker.js method with simple syntax
@person.firstName
@internet.email
@company.name
š§® Parameter Support
Pass parameters to control output
@number.int(1, 100)
@lorem.words(5)
@date.past(2)
š String Concatenation
Combine values with expressions
@person.firstName + " " + @person.lastName
š Array Repetition
Generate arrays with @repeat directive
[{ "id": @number.int }] @repeat(5)
šļø Nested Structures
Support for complex nested objects and arrays
{
"user": {
"profile": {
"address": {
"street": "@location.streetAddress"
}
}
}
}
Complete Example
Here's a comprehensive template showing all features:
{
"users": [
{
"id": @number.int(1, 1000),
"name": @person.firstName + " " + @person.lastName,
"email": @internet.email,
"age": @number.int(18, 65),
"address": {
"street": @location.streetAddress,
"city": @location.city,
"country": @location.country,
"zipCode": @location.zipCode
},
"profile": {
"bio": @lorem.paragraph,
"avatar": @internet.avatar,
"joinedAt": @date.past
},
"isActive": @datatype.boolean
}
] @repeat(3),
"meta": {
"total": @number.int(100, 10000),
"company": @company.name,
"description": @lorem.paragraph
}
}
Available Categories
āļø Airline
- aircraftType, airline
- airplane, airport
- flightNumber
š¦ Animal
- bird, cat, dog
- fish, horse, rabbit
- snake, type
š Book
- author, format
- genre, publisher
- series, title
šØ Color
- cmyk, hsl, rgb
- human, space
- hwb, lab, lch
š Commerce
- department, isbn
- price, product
- productName
š¢ Company
- name, catchPhrase
- buzzPhrase
- catchPhraseNoun
šļø Database
- column, collation
- engine, type
- mongodbObjectId
š Datatype
- array, bigInt
- boolean, datetime
- json, uuid
š Date
- past, future
- recent, soon
- birthdate, month
š° Finance
- account, amount
- bitcoinAddress
- creditCardNumber
- currencyCode, iban
š Food
- adjective, dish
- fruit, ingredient
- meat, spice
š Git
- branch, commitSha
- commitMessage
- commitDate
š» Hacker
- abbreviation
- adjective, noun
- phrase, verb
š¼ļø Image
- avatar, dataUri
- url, urlLoremFlickr
- urlPicsumPhotos
š Internet
- email, userName
- url, domainName
- ip, password, mac
š Location
- city, country
- streetAddress
- zipCode, latitude
š Lorem
- word, words
- sentence, paragraph
- slug, text
šµ Music
- artist, genre
- songName
š¢ Number
- int(min, max)
- float, bigInt
- binary, hex, octal
š¤ Person
- firstName, lastName
- fullName, jobTitle
- gender, bio
š± Phone
- number, imei
š¬ Science
- chemicalElement
- unit
š¤ String
- alpha, alphanumeric
- binary, hexadecimal
- uuid, nanoid
š¾ System
- fileName, fileExt
- filePath, mimeType
- cron, semver
š Vehicle
- bicycle, color
- fuel, manufacturer
- model, type, vin
š Word
- adjective, adverb
- noun, verb
- conjunction
š ļø Helpers
- arrayElement
- fake, maybe
- shuffle, slugify