import { env } from "https://deno.land/x/drake@v1.7.0/lib/env.ts";
The Drake env
API function gets and optionally sets the command-line
options, task names and variables.
Options are keyed by their long option name e.g. env("--dry-run")
.
Command-line flag options return a boolean; the --cache
and --directory
options
return a string.
Command-line variables are keyed by name. For example vers=1.0.1
on the
command-line sets the vers
value to "1.0.1"
.
Command-line tasks are stored in the --tasks
string array.
Examples:
env("--abort-exits", true);
env("--default-task", "test");
console.log(`version: ${env("vers")}`);
if (!env("--quiet")) console.log(message);