Synopsis

Downloads a LoopBack example project from ourGitHub monorepo.

  1. lb4 example [options] [<example-name>]

Options

Standard options

  • -h, —help
  • Print the generator’s options and usage.
  • —skip-cache
  • Do not remember prompt answers. Default is false.
  • —skip-install
  • Do not automatically install dependencies. Default is false.
  • -c, —config
  • JSON file name or value to configure options
  • —format
  • Format generated code using npm run lint:fixFor example,
  1. lb4 app --config config.json
  2. lb4 app --config '{"name":"my-app"}'
  3. cat config.json | lb4 app --config stdin
  4. lb4 app --config stdin < config.json
  5. lb4 app --config stdin << EOF
  6. > {"name":"my-app"}
  7. > EOF
  • -y, —yes
  • Skip all confirmation prompts with default or provided value

Arguments

example-name - Optional name of the example to clone. If provided, the toolwill skip the example-name prompt and run in a non-interactive mode.

See Examples and Tutorials for the list ofavailable examples.

Interactive Prompts

The tool will prompt you for:

  • Name of the example to download. If the name had been supplied from thecommand-line, the prompt is skipped.

Output

The example project is downloaded to a new directory and its dependencies areinstalled. For example, when downloading todo example, the tool stores thefiles under the newly created loopback4-example-todo directory.