Skip to main content
Module

x/drake/mod.ts>env

Drake is a make-like task runner for Deno.
Go to Latest
variable env
Re-export
import { env } from "https://deno.land/x/drake@v1.6.0/mod.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);