Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 598 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 598 Bytes

shelljs-promise

A high-level function for shelljs using promises. Optional support for escaping shell commands.

Unescaped shell command

const { shellExec } = require('@annoai/shelljs-promise')

shellExec('ls -al')
  .then((stdout) => {
    console.log(stdout)
  })
  .catch((stderr) => {
    console.log(stderr)
  })

Escaped shell command (supports array of strings only)

const { shellExec } = require('@annoai/shelljs-promise')

shellExec(['ls', '-al'])
  .then((stdout) => {
    console.log(stdout)
  })
  .catch((stderr) => {
    console.log(stderr)
  })