Polyfill of spawnSync and execSync for Node-0.10.x (Unix only yet)
npm install runsyncPolyfill of spawnSync and execSync for Node-0.10.x (Unix only yet)



``sh`
$ npm install runsync
`js
var runsync = require("runsync");
var result = runsync.spawn("echo", ["Hello", "World!"], { encoding: "utf8" });
console.log(result.stdout); // => Hello world!\n
runsync.exec("sleep 1");
result = runsync.popen("echo Error message 1>&2", { encoding: "utf8" });
console.log(result.stderr); // => Error message\n
`
`js`
var res = runsync.spawn("node", ["-e", "console.log('Hello, World!')"], { encoding: "utf8" });
console.log(res.stdout) // => 'Hello, World!\n'
-----
`js`
var output = runsync.exec("sleep 3 && echo Hello!", { timeout: 1000 });
// => throw Exception because of timeout
-----
`js`
var html = runsync.execFile("curl", ["--silent", "-X", "GET", "http://example.com"]);
console.log(html.toString()); // => '\n\n\n ...'
-----
, but it returns spawn object likes runsync.spawn.
* This method will not throw Exceptions even if command fails.`js
var result = runsync.popen("echo cat && echo strerr 1>&2", { input: "stdin", encoding: "utf8" });
console.log(result.stdout) // => "stdin\n"
console.log(result.stderr) // => "stderr\n"
`-----
$3
* This is similar to runsync.exec, but always set 'inherit' to options.stdio.
* Returns Nothing(undefined).
* This method will throw Exceptions if command fails.`js
try {
runsync.shell("mocha --reporter nyan");
// 31 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_,------,
// 1 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_| /\_/\
// 0 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-^|__( x .x)
// -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- "" ""
// 31 passing (468ms)
// 1 failing} catch(err) {
console.log(err.message);
// => 'Command failed:
mocha -u tdd --reporter nyan'
}
``