@dogmalang/exec

0.1.0 • Public • Published

@dogmalang/exec

NPM version Total downloads

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) : object
  • cmd, 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? When callback, this option is always true.
    • enc (string), the output encoding.
    • async (bool), asynchronously? If true, 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) : object

pexec()

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]

Readme

Keywords

Package Sidebar

Install

npm i @dogmalang/exec

Weekly Downloads

1

Version

0.1.0

License

none

Unpacked Size

4.98 kB

Total Files

3

Last publish

Collaborators

  • dogmalang