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

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

A modern runtime for JavaScript and TypeScript.
Go to Latest
variable Deno.args
import { Deno } from "https://deno.land/x/deno@v1.28.0/cli/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://deno.land/std/examples/cat.ts /etc/passwd

Then Deno.args will contain:

[ "/etc/passwd" ]

If you are looking for a structured way to parse arguments, there is the std/flags module as part of the Deno standard library.

type

string[]