import { build$ } from "https://deno.land/x/dax@0.9.0/mod.ts";
Builds a new $
which will use the state of the provided
builders as the default.
This can be useful if you want different default settings.
Example:
import { build$ } from "https://deno.land/x/dax/mod.ts";
const commandBuilder = new CommandBuilder()
.cwd("./subDir")
.env("HTTPS_PROXY", "some_value");
const requestBuilder = new RequestBuilder()
.header("SOME_VALUE", "value");
const $ = build$({ commandBuilder, requestBuilder });
// this command will use the env described above, but the main
// process and default `$` won't have its environment changed
await $`deno run my_script.ts`;
// similarly, this will have the headers that were set in the request builder
const data = await $.request("https://plugins.dprint.dev/info.json").json();
Parameters
options: Create$Options