bound-spawn

2.0.0 • Public • Published

bound-spawn

Bind child_process.spawn to a command and configuration.

usage

const node = require(`bound-spawn`)(
  `node`,
  {
    args: {
      alias: {
        eval: `-e`
      }
    }
  }
)
 
node({ eval: `console.log('hello')` })
.stdout.on(`data`, data => console.log(data.toString()))

api

boundSpawn(command[, configuration])

  • command - <string> the command to run
  • configuration - <Object>
    • args - <Object> configure options-to-args
      • prefix - <string>
      • alias - <Object>
      • behaviour - <Object>
    • options - <Object> same as the options object in the documentation for child_process.spawn.

Returns a function with the following signature:

fn([options])

Returns <ChildProcess>

.args

The options-to-args module

Package Sidebar

Install

npm i bound-spawn

Weekly Downloads

3

Version

2.0.0

License

MIT

Last publish

Collaborators

  • rogerbf