1.1.1 • Published 4 months ago

v_execute v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

🌀 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

1.1.1

4 months ago

1.1.0

4 months ago

1.1.3

4 months ago

1.0.2

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago