Skip to content

Commit

Permalink
Fixed unsupported fd type error in json2msgpack (fixes pgriess#58)
Browse files Browse the repository at this point in the history
Borrowed the fix from here chjj/pty.js#32 (comment)
  • Loading branch information
detunized authored Jul 14, 2016
1 parent 3c05e7f commit 6c30ec5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/json2msgpack
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// Read JSON data from stdin and write MessagePack data to stdout.

var msgpack = require('msgpack');
var net = require('net');
var tty = require('tty');

var data = '';

var s = new net.Stream(0);
var s = new tty.ReadStream(0);
s.addListener('data', function(d) {
data += d;
});
s.addListener('end', function() {
s = new net.Stream(1);
s = new tty.WriteStream(1);
s.resume();

if (s.write(msgpack.pack(JSON.parse(data)))) {
Expand Down

0 comments on commit 6c30ec5

Please sign in to comment.