Skip to content

C++ Faker library based on faker-js/faker.

License

Notifications You must be signed in to change notification settings

sikofitt/faker-cxx

 
 

Repository files navigation

C++ Faker

build and test codecov

faker-cxx is a modern C++20 open-source library for generating fake data for testing and development.

It has no dependencies beyond Boost library (and GTest for unit tests).

🎯 Goal

My goal is to create a simple, modern C++ Faker library similar to faker-js/faker.

Example

Lets dive into some simple example of generating fake data for some user

#include <format>
#include <iostream>
#include "faker-cxx/Internet.h"
#include "faker-cxx/String.h"

int main()
{
    const auto id = faker::String::uuid();
    const auto email = faker::Internet::email();
    const auto password = faker::Internet::password();

    std::cout << std::format("id: {}, email: {}, password: {}", id, email, password);

    return 0;
}

Consuming library with CMake

add_subdirectory(third_party/faker-cxx)

add_executable(main main.cpp)

target_link_libraries(main faker-cxx)

💎 Modules

  • 🌐 Internet - Generate emails, usernames and passwords.
  • 🧑 Person - Generate first, last names.
  • 🔢 Number - Generate random numbers.
  • 📚 Lorem - Generate lorem text.
  • 🔢 String - Generate uuids.

🔨 TODO Modules

  • 🌍 Localization - Generate addresses.
  • 📅 Date - Generate past, future dates.
  • 👕 Commerce - Generate prices, product names, and descriptions.
  • 🐘 Animal - Generate animal types and names
  • 🎨 Color - Generate RGB colors and color names
  • 🏢 Company - Generate company name, location
  • ℹ️ Datatype - Generate strings, numbers, booleans
  • 🎶 Music - Generate music genre, song names
  • 📖 Book - Generate book genre, title, author, isbn, published year
  • 📞 Phone - Generate phone number
  • 🎮 Game - Generate game genre, title

✨ Contributing

Please feel free to join Faker C++ development! 🚀

About

C++ Faker library based on faker-js/faker.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 52.1%
  • CMake 47.9%