@perl/qx
v1.1.0
Published
Run external commands and capture their status
Downloads
85
Readme
@perl/qx
Run a command and capture its return status.
const qx = require('@perl/qx')
// capture the output from `ls -l`
const output = await qx`ls -l`
// with promises
qx`ls -l`.then(output => console.log(output))
// also available in synchronous version
const output = qx.sync`ls -l`
// or as an ordinary function (handy because it avoids needing quoting)
const output = await qx('ls', '-l')
qx('ls', '-l').then(output => console.log(output))
const output = qx.sync('ls', '-l')
Origins
This is intended to provide the same functionality as the Perl qx syntax.