0.1.8 • Published 8 years ago
spawn-promise v0.1.8
spawn-promise
Spawns a process and makes it simple to pipe data in and get data out.
Installation
npm install spawn-promiseUsage
var spawn = require(spawn-promise);
spawn('grep', ['H'], 'Hello').then(function (buffer) {
console.log(buffer.toString()); // Hello
});API
spawn ( command , args )
Spawns a child process with the given command, writes the input value to stdin, and returns a Promise that is fulfilled with the concatenated stdout buffer.
Arguments
command- The command to run.args- An array of arguments to run thecommandwith.input- The value to write tostdin.