Overview
Learn how to define typed parameters for templates.
Templates accept typed parameters called options. When a user applies a template, the CLI prompts for any required options that were not provided.
Definition
Options are defined as named entries under the options property:
"options": { "name": { "type": "string", "description": "The project name.", "default": "my-app" }, "typescript": { "type": "boolean", "description": "Whether to use TypeScript.", "default": true }}Option values are accessible in expressions through the options variable. For example, ${options.name}.
Properties
The following list describes the properties common to all option types:
- typestring
- descriptionstring
A description displayed when prompting the user.
- default(optional)any
The default value used when the user does not provide one.