0.1.2 • Published 5 years ago

@dogmalang/exec.async v0.1.2

Weekly downloads
1
License
-
Repository
github
Last release
5 years ago

@dogmalang/exec.async

NPM version Total downloads

Functions for executing lines from shell, asynchronously.

Engineered in Valencia, Spain, EU by Justo Labs.

Use

const {exec, execf, pexec} = require("@dogmalang/exec.async");

exec()

It executes a command:

async function exec(...cmd) : object
async function exec(...cmd, opts:object) : object
  • cmd, the command to run.
  • opts, the options:
    • workDir (string), the work directory to use.
    • env (object), the environment variables to use.
    • detach (bool or number), detach the execution? When a number, this is the milliseconds to wait before returning and detecting an error during this interval.
    • enc (string), the output encoding.

execf()

Similar to exec(), but for a command with format:

async function execf(fmt:string, ...args) : object
async function execf(fmt:string, ...args, opts:object) : object