Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/flags/mod.ts

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
import * as mod from "https://deno.land/std@0.190.0/flags/mod.ts";

Command line arguments parser based on minimist.

This module is browser compatible.

Examples

Example 1

import { parse } from "https://deno.land/std@0.190.0/flags/mod.ts";

console.dir(parse(Deno.args));
$ deno run https://deno.land/std/examples/flags.ts -a beep -b boop
{ _: [], a: 'beep', b: 'boop' }
$ deno run https://deno.land/std/examples/flags.ts -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
{ _: [ 'foo', 'bar', 'baz' ],
  x: 3,
  y: 4,
  n: 5,
  a: true,
  b: true,
  c: true,
  beep: 'boop' }

Functions

Take a set of command line arguments, optionally with a set of options, and return an object representing the flags found in the passed arguments.

Interfaces

The options for the parse call.

Type Aliases

The value returned from parse.