Sacré bleu! Running shell commands from Node just can't get any simpler.
I always have to look up
child_process whenever I need to run some shell command in Node. While this may be a good thing - I will learn something eventually - sometimes I just want to run the freaking thing.
This library offers a really really straitforward way to run shell commands. I dare you to not understand it.
npm install meshell
const Shell =const sh =const output = await// start in a particular directory (defaults to process.cwd())const sh = cwd: '/some/dir'// change it latersh// background process; returns instead of output; does not wait for the process to completeconst pid = await// collect output as it comesawait
Print all commands and their output to console:
DEBUG=meshell node myScript.js