v_execute
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

🌀 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

👻 Author: -<[_.⟁._]>-

⏰ CreatedTime: 07.01.2023 @ 15:44

Package Sidebar

Install

npm i v_execute

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

37.1 kB

Total Files

20

Last publish

Collaborators

  • v-core9