Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 1.11 KB

README.md

File metadata and controls

48 lines (32 loc) · 1.11 KB

xk6-faker

xk6-faker random fake data generator

The main generator class is Faker.

import { Faker } from "k6/x/faker"

let f = new Faker();
console.log(f.name());

Pass a random seed number to Faker constructor if you want to get deterministic random values.

import { Faker } from "k6/x/faker"

let f = new Faker(1234);
console.log(f.name());

For easier usage, the module's default export is a Faker instance too, so you can use generator functions without instantiating the Faker class:

import faker from "k6/x/faker"

console.log(faker.name())

You can pass random seed value in XK6_FAKER_SEED env if you want deterministic generated random values.

Table of contents

Classes

Interfaces