Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/denoexec/lib/functional.ts>$

A higher level wrapper around https://doc.deno.land/builtin/stable#Deno.run
Latest
function $
import { $ } from "https://deno.land/x/denoexec@v1.1.5/lib/functional.ts";

$ emulates a sub shell, essentially it sets inheritStdio to false & captureStdio to true and then returns the result of stdioCombined().

Example Usage:

const branch = await $(_`git rev-parse --abbrev-ref HEAD`);

Also accepts a string template literal directly:

const branch = await $`git rev-parse --abbrev-ref HEAD`;

Or an list of arguments:

const branch = await $("git", "rev-parse", "--abbrev-ref", "HEAD");

Parameters

...args: string[]

Returns

Promise<string>

Parameters

strings: TemplateStringsArray
...values: string[]

Returns

Promise<string>