Make use of get-stdin

This commit is contained in:
Juan Cruz Viotti 2015-02-05 09:10:10 -04:00
parent 0dba133b0a
commit 8adf943e51
2 changed files with 3 additions and 15 deletions

View File

@ -1,21 +1,8 @@
_ = require('lodash')
getStdin = require('get-stdin')
# TODO: Find a sane way to test streams
exports.readStdin = (callback) ->
stdin = process.stdin
stdin.resume()
stdin.setEncoding('utf8')
result = []
stdin.on('error', callback)
stdin.on 'data', (chunk) ->
result.push(chunk)
stdin.on 'end', ->
result = result.join()
getStdin (result) ->
return callback(null, result)
exports.parseCredentials = (credentials, callback) ->

View File

@ -51,6 +51,7 @@
"conf.js": "^0.1.1",
"diskio": "^1.0.0",
"drivelist": "^1.1.0",
"get-stdin": "^4.0.1",
"git-cli": "~0.8.2",
"lodash": "~2.4.1",
"lodash-contrib": "~241.4.14",