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

x/denoexec/mod.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/mod.ts";

_ is a short cut for exec({ cmds: [...args] }).

This returns a ProcessDeferred object, which does absolutely nothing until it is awaited. This allows you to modify the ProcessDeferred instance with the rest of the functional API. And then finally execute the configured child process and await it's results.

Example Usage:

await _("ping", "-c", "4", "1.1.1.1"); // streams the io to your console

Alternatively use as a template literal tag function.

Example Usage:

const ip = '1.1.1.1';
await _`ping -c 4 ${ip}`;

TIP: If you ever struggle with argument quoting, we suggest avoiding the tagged template literal function and simply supplying an array of strings, this avoids all confusion & the complexities of parsing a template literal into a command array. It is only provided as a convenience for simple cases.

Parameters

strings: TemplateStringsArray
...values: string[]

Returns

ProcessDeferred

Parameters

...args: string[]

Returns

ProcessDeferred