v_execute
v1.1.1
Published
Node Module that only requires a single function call to execute some bash/shell code in a child_process
Downloads
18
Maintainers
Readme
🌀 v_execute( <_command_> )
Node Module that only requires a single function call to execute some bash/shell code in a child_process
⏩ Installing__
npm i v_execute --save
💥 How to use__
Well just load it as a constant...and have fun...
Common JS
const { v_execute, hof_v_cp } = require('./v_execute')
// Simple listing
console.log( await v_execute("ls") ) //-> { stdout, stderr }
// Check git status
console.log( await v_execute("git status") )
// Create a child_process
const cp = hof_v_cp(
undefined,
(data)=> console.log(data), // stdout.on('data', cbFn)
(data) => console.warn(data) // stderr.on('data', cbFn)
)
cp.runCmd("ls")
cp.sendCommand("ls")
console.log(cp.child) //-> child_process instance
ES Modules
import { v_execute, hof_v_cp } from 'v_execute'
// Simple listing
console.log( await v_execute("ls") ) //-> { stdout, stderr }
// Check git status
console.log( await v_execute("git status") )
// Create a child_process
const cp = hof_v_cp(
undefined,
(data)=> console.log(data), // stdout.on('data', cbFn)
(data) => console.warn(data) // stderr.on('data', cbFn)
)
cp.runCmd("ls")
cp.sendCommand("ls")
console.log(cp.child) //-> child_process instance