@annoai/shelljs-promise

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

Usage no npm install needed!

<script type="module">
  import annoaiShelljsPromise from 'https://cdn.skypack.dev/@annoai/shelljs-promise';
</script>

README

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)
  })