Plato on Github
Report Home
ampersand/lib/helpers/stdin.js
Maintainability
76.21
Lines of code
14
Difficulty
8.53
Estimated Errors
0.11
Function weight
By Complexity
By SLOC
module.exports = function getStdin(cb) { if (process.stdin.isTTY) return cb(''); var buf = ''; process.stdin.setEncoding('utf8'); process.stdin.on('readable', function() { var chunk = process.stdin.read(); if (chunk !== null) { buf += chunk.toString(); } }); process.stdin.on('end', function() { cb(buf); }); };