In the following TypeScript example, we're expecting two possible CLI parameters, --build
and --port
. We prepare a paramMap
variable that has default values for all parameters, which are overwritten for each parameter that is manually passed in via the CLI.
See further down for a TypeScript example without comments as well as a JavaScript example.
// create an enum that contains each of the params
enum Params {
BUILD = '--build',