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

x/dxx/src/lib/xArgs.ts>argsAsync

🚀 (Deno) enhanced executor
Latest
function argsAsync
import { argsAsync } from "https://deno.land/x/dxx@rf/src/lib/xArgs.ts";

Parse (if needed) and 'shell'-expand argument text string(s).

  • Performs bash-like expansion (compatible with the Bash v4.3 specification).
  • Quotes (single or double) are used to protect braces, tildes, and globs from expansion; unbalanced quotes are allowed (and parsed as if completed by the end of the string).
  • ANSI-C strings (eg, $'...') are supported and expanded; otherwise, no character escape sequences are recognized.
  • Brace expansion is fully implemented (including nested braces and "brace bomb" protections).
  • Glob expansion supports globstar and full extended glob syntax.

Uses the braces* and picomatch JS modules.

Examples

Example 1

const argsText = '{.,}"text string" ./src/file_{1..10..2}_*.ts';
const expansion: string[] = await argsAsync(argsText);

Parameters

argsText: string | string[]
optional
options: ArgsOptions = [UNSUPPORTED]