Hex.pm Version Hex.pm Downloads Elixir CI

NeoFaker is a fake data generator for Elixir tests and development environments.

Requirements

  • Erlang: 28.0 or newer
  • Elixir: 1.18.4-otp-28 or newer

Installation

Add NeoFaker to your mix.exs dependencies:

def deps do
  [
    {:neo_faker, "~> 0.14.0", only: [:dev, :test]}
  ]
end

Then fetch the dependency:

mix deps.get

Configuration

Set the default locale in config/config.exs:

config :neo_faker, locale: :default

If the requested locale is unavailable, NeoFaker falls back to :default (generic English US data). See the supported locales for a full list.

Phoenix Projects

For Phoenix apps, set the locale in config/dev.exs or config/test.exs instead. In test/test_helper.exs, add:

ExUnit.start()
NeoFaker.start()

Usage

iex> NeoFaker.App.name()
"Neo Faker"

iex> NeoFaker.App.description()
"Fake data generator for Elixir tests and development environments."

iex> NeoFaker.App.description(locale: :id_id)
"Penghasil data palsu untuk pengujian dan lingkungan pengembangan Elixir."

For detailed documentation, see the API Reference. For a quick overview, see the Cheat Sheet.

License

Licensed under the MIT License.