Skip to content
Adam Smith edited this page Mar 3, 2016 · 10 revisions

vitals.run npm version

Method Section Alias
run shell

run

A shortcut for child_process.spawnSync that returns the stdout. Note that vitals.run is considered unstable as it does not yet have a test suite. It is also scheduled for a future rebuild. Use with caution and if possible help out by contributing some unit tests.

Examples

Params

  1. cmd string

  2. opts Object= - opts.eol ?string=

    default value: "LF"

    The end of line character to use when normalizing the result. If opts.eol is null or opts.buffer is true and opts.eol is undefined no normalization is completed. Optional values:

    • "LF"
    • "CR"
    • "CRLF" - opts.buffer boolean=

    default value: false

    If true and stdout is a buffer the buffer is returned. Otherwise a string of stdout is returned. - opts.catchExit boolean=

    default value: true

    If process is exited with an error code an error is logged. - opts.encoding string=

    default value: "utf8"

    If opts.buffer is true and opts.encoding is undefined no encoding is set. - opts.cwd string= - opts.input (!Buffer|string)= - opts.env !Object= - opts.uid number= - opts.gid number= - opts.timeout number= - opts.killSignal string= - opts.maxBuffer number=

Returns (!Buffer|string)

-- Happy Developing,

Algorithm IV Logo

Clone this wiki locally