import { _ } from "https://deno.land/x/denoexec@v1.1.5/lib/functional.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.