Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/deno_minimist/types/minimist.d.ts>MinimistOptions

💾 Parses command line arguments. Port & rewrite of the node library minimist
Latest
interface MinimistOptions
import { type MinimistOptions } from "https://deno.land/x/deno_minimist@v1.0.2/types/minimist.d.ts";

Properties

optional
string: string | string[]

A string or array of strings argument names to always treat as strings.

optional
boolean: boolean | string | string[]

A boolean, string or array of strings to always treat as booleans. If true will treat all double hyphenated arguments without equals signs as boolean (e.g. affects --foo, not -f or --foo=bar).

optional
alias: { [key: string]: string | string[]; }

An object mapping string names to strings or arrays of string argument names to use as aliases.

optional
default: { [key: string]: unknown; }

An object mapping string argument names to default values.

optional
stopEarly: boolean

When true, populate argv._ with everything after the first non-option.

optional
unknown: (arg: string) => boolean

A function which is invoked with a command line parameter not defined in the opts configuration object. If the function returns false, the unknown option is not added to argv.

optional
--: boolean

When true, populate argv._ with everything before the -- and argv['--'] with everything after the --. Note that with -- set, parsing for arguments still stops after the --.