executely
Version:
Wrapper script around child_process execFile and spawn to make it more convenient to run bash commands from a node.js script.
14 lines (12 loc) • 378 B
JavaScript
const execute = require('executely').execute;
(async () => {
console.log('First example with spawn: ');
/*
* execute a command, using spawn.
* We cannot access output, and it's sent to stdout by default.
*/
await execute('ls -ltrSha').then((statusCode) => {
console.log('spawn: ' + statusCode);
console.log('-------');
});
})();