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

x/deno/cli/tsc/dts/lib.deno.ns.d.ts>Deno.args

A modern runtime for JavaScript and TypeScript.
Latest
variable Deno.args
import { Deno } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.ns.d.ts";
const { args } = Deno;

Returns the script arguments to the program.

Give the following command line invocation of Deno:

deno run --allow-read https://examples.deno.land/command-line-arguments.ts Sushi

Then Deno.args will contain:

[ "Sushi" ]

If you are looking for a structured way to parse arguments, there is parseArgs() from the Deno Standard Library.

type

string[]