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 runconfiguration
- <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