Synopsis

Creates a new LoopBack4 extension.

  1. lb4 extension [options] [<name>]

Options

—description : Description of the extension.

—outDir : Project root directory for the extension.

—eslint : Add ESLint to LoopBack4 extension project.

—prettier : Add Prettier to LoopBack4 extension project.

—mocha : Add Mocha to LoopBack4 extension project.

—loopbackBuild : Add @loopback/build module’s script set to LoopBack4extension project.

—vscode: Add VSCode config files to LoopBack4 application projectStandard 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

<name> - Optional name of the extension given as an argument to the command.If provided, the tool will use that as the default when prompting for the name.

Interactive Prompts

The tool will prompt you for:

  • Name of the extension as will be shown in package.json. If the name had beensupplied from the command-line, the prompt is skipped and the extension isbuilt with the name from the command-line argument. Must follow npm namingconventions.

  • Description of the extension as will be shown in package.json.

  • Name of the directory in which to create your extension. Defaults to the nameof the extension previously entered.

  • Optional modules to add to the extension. These modules are helpful tools tohelp format, test, and build a LoopBack4 extension. Defaults to true for allof the modules. The prompted modules are: