I\'ve been doing this to synchronously read the whole stdin data under Linux:
var buffer = fs.readFileSync(\'/dev/stdin\');
This obviously
var size = fs.fstatSync(process.stdin.fd).size; var buffer = size > 0 ? fs.readSync(process.stdin.fd, size)[0] : '';