0.5.1 • Published 7 months ago

@tehdb/faker-cli v0.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Faker CLI

Faker CLI is a command-line interface wrapper for the @faker-js/faker library, which allows you to generate fake data directly from your terminal.

📦 Install

npm install -g @tehdb/faker-cli

🪄 Usage

faker -m <module-name> -f <function-name> [-p <param-value>] [-p <param-key>:<param-value>]... [-l <locale>]

Options

  • -V, --version Output the version number
  • -m, --module-name <value> The name of the faker module
  • -f, --function-name <value> The name of the function in the module
  • -p, --parameter [value...] Function parameters as simple value and/or key-value pairs, separated by semicolons (default: [])
  • -l, --locale <value> The locale (default: "en")
  • -h, --help Display help for command

For modules and supported functions see faker api reference

For supported locales see available locales

Generate data using a specific module and function:

faker -m lorem -f words

Generate data with a specific locale:

faker -m lorem -f words -l de

Generate data with simple parameters:

faker -m lorem -f words -p 5

Generate data with key-value pairs parameters:

faker -m lorem -f words -p min:4 -p max:7

Alternative syntax:

faker --module-name="lorem" --function-name="words"
faker --module-name="lorem" --function-name="words" --parameter=5
faker --module-name="lorem" --function-name="words" --parameter="min:4" --parameter="max:7"
faker --module-name="lorem" --function-name="words" --locale="de"

Shortened syntax:

faker lorem.words
faker lorem words
faker lorem words de
faker lorem words 5
faker lorem words 5 de
faker lorem words min:4 max:5
faker lorem words min:4 max:5 de
0.5.0

7 months ago

0.4.0

7 months ago

0.5.1

7 months ago

0.3.2

7 months ago

0.3.1

7 months ago

0.3.0

7 months ago

0.2.0

7 months ago

0.1.0

7 months ago