Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/yargs_parser/lib/yargs-parser-types.ts>Options

💪 the mighty option parser used by yargs
Go to Latest
interface Options
import { type Options } from "https://deno.land/x/yargs_parser@yargs-parser-v21.1.0-deno/lib/yargs-parser-types.ts";

Properties

alias: Dictionary<string | string[]>

An object representing the set of aliases for a key: { alias: { foo: ['f']} }.

Indicate that keys should be parsed as an array: { array: ['foo', 'bar'] }. Indicate that keys should be parsed as an array and coerced to booleans / numbers: { array: [ { key: 'foo', boolean: true }, {key: 'bar', number: true} ] }`.

boolean: string | string[]

Arguments should be parsed as booleans: { boolean: ['x', 'y'] }.

config: string | string[] | Dictionary<boolean | ConfigCallback>

Indicate a key that represents a path to a configuration file (this file will be loaded and parsed).

configObjects: Dictionary<any>[]

configuration objects to parse, their properties will be set as arguments

configuration: Partial<Configuration>

Provide configuration options to the yargs-parser.

Provide a custom synchronous function that returns a coerced value from the argument provided (or throws an error), e.g. { coerce: { foo: function (arg) { return modifiedArg } } }.

count: string | string[]

Indicate a key that should be used as a counter, e.g., -vvv = {v: 3}.

default: Dictionary<any>

Provide default values for keys: { default: { x: 33, y: 'hello world!' } }.

optional
envPrefix: string

Environment variables (process.env) with the prefix provided should be parsed.

narg: Dictionary<number>

Specify that a key requires n arguments: { narg: {x: 2} }.

normalize: string | string[]

path.normalize() will be applied to values set to this key.

string: string | string[]

Keys should be treated as strings (even if they resemble a number -x 33).

number: string | string[]

Keys should be treated as numbers.

__: (format: any, ...param: any[]) => string

i18n handler, defaults to util.format

key: Dictionary<any>

alias lookup table defaults