Raise shell in node, inspired by shellblazer
but gives you access to the process itself.
npm i --save shellraiser
const sh = require('shellraiser')
await sh('ls')
await sh('npm', ['i -S shhh'])
await sh('curl', ['https://github.com'], { stdio: 'inherit' })
shhh ls
shhh npm i -S shhh
The sh
function spawns a process, it is essentially a thin wrapper around const { spawn } = require('child_process')
Spawn a process that executes cmd
with args
given opts
.
The arguments to sh
are the same as spawn
.
Optionally, you can await
completion of the process with await sh(cmd, args, opts)
.
Just like Promise
's .then()
.
Just like Promise
's .catch()
.
Forcibly resolve the underlying promise with an arbitrary value, automatically cleans up the underlying process.
Forcibly reject the underlying promise with an arbitrary value, automatically cleans up the underlying process.
The underlying process object.
The underlying promise.