3 module.exports = function (cb) {
4 var stdin = process.stdin;
12 stdin.setEncoding('utf8');
14 stdin.on('readable', function () {
17 while (chunk = stdin.read()) {
22 stdin.on('end', function () {
27 module.exports.buffer = function (cb) {
28 var stdin = process.stdin;
33 setImmediate(cb, new Buffer(''));
37 stdin.on('readable', function () {
40 while (chunk = stdin.read()) {
46 stdin.on('end', function () {
47 cb(Buffer.concat(ret, len));