Interface Book

Generator to generate book related entries.

interface Book {
    book(): Record<string, string>;
    bookAuthor(): string;
    bookGenre(): string;
    bookTitle(): string;
}

Methods

  • Written or printed work consisting of pages bound together, covering various subjects or stories.

    Returns Record<string, string>

    a random book

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

    let faker = new Faker(11)

    export default function () {
    console.log(faker.book.book())
    }

    Output (formatted as JSON value)

    {"Title":"The Brothers Karamazov","Author":"Albert Camus","Genre":"Urban"}
    
  • The individual who wrote or created the content of a book.

    Returns string

    a random book author

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

    let faker = new Faker(11)

    export default function () {
    console.log(faker.book.bookAuthor())
    }

    Output (formatted as JSON value)

    "Edgar Allan Poe"
    
  • Category or type of book defined by its content, style, or form.

    Returns string

    a random book genre

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

    let faker = new Faker(11)

    export default function () {
    console.log(faker.book.bookGenre())
    }

    Output (formatted as JSON value)

    "Erotic"
    
  • The specific name given to a book.

    Returns string

    a random book title

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

    let faker = new Faker(11)

    export default function () {
    console.log(faker.book.bookTitle())
    }

    Output (formatted as JSON value)

    "The Brothers Karamazov"