0.1.0 • Published 7 years ago
@dogmalang/exec v0.1.0
@dogmalang/exec
Functions for executing lines from shell.
Engineered in Valencia, Spain, EU by Justo Labs.
Use
const {exec, execf, pexec} = require("@dogmalang/exec");exec()
It executes a command:
function exec(...cmd) : object
function exec(...cmd, opts:object) : object
function exec(...cmd, callback:function) : objectcmd, the command to run.callback, the function to call when the run ended.opts, the options:workDir(string), the work directory to use.env(object), the environment variables to use.detach(bool), detach the execution? Whencallback, this option is alwaystrue.enc(string), the output encoding.async(bool), asynchronously? Iftrue, the function returns a promise. Default:false.
execf()
Similar to exec(), but for a command with format:
function execf(fmt:string, ...args) : object
function execf(fmt:string, ...args, opts:object) : object
function execf(fmt:string, ...args, callback:function) : objectpexec()
Similar to exec() but in protected mode:
function pexec(...cmd) : [ok, result]
function pexec(...cmd, opts: object) : [ok, result]
function pexec(...cmd, callback:function) : [ok, result]0.1.0
7 years ago