返回 Skill 列表
extension
分类: 开发与工程无需 API Key

faker

在编写需要使用faker生成器来生成真实测试数据(如姓名、电子邮件、地址、日期等)的Vague (.vague)文件时使用

person作者: jakexiaohubgithub

Faker Plugin for Vague

Quick Start

schema User {
  id: uuid()
  name: fullName()
  email: email()
  phone: phone()
  city: city()
}

Core Principles

  • Use shorthand generators for common cases (no faker. prefix needed)
  • Use full namespace faker.module.method() for less common generators

Common Shorthand Generators

uuid(), email(), phone(), firstName(), lastName(), fullName(), companyName(), city(), country(), countryCode(), zipCode(), streetAddress(), url(), avatar(), iban(), currencyCode(), pastDate(), futureDate(), sentence(), paragraph()

Full Namespace Example

schema Employee {
  title: faker.person.jobTitle()
  bio: faker.lorem.sentences(3)
  cardNumber: faker.finance.creditCardNumber()
}

Reference Files

For complete generator list: references/generators.md