I have trouble with event-stream in a pg callback. I was able to reduce it with this small piece of code:
var es = require('event-stream');
var pg = require('pg');
var ar = ['dd','dd','aa'];
var s1 = es.readArray(ar);
var s2 = es.readArray(ar);
var k1 = s1.pipe(es.map(function(i,cb){console.log(i);cb()}));
pg.connect("______my_string_____",function(err, client,pgdone) {
var k2 = s2.pipe(es.map(function(i,cb){console.log(i);cb()}));
console.log(err);
pgdone();
})
If i run that code, the assignment of k1 results in a display of the array, as expected. But the assignment of k2 does nothing, being the same piece of code.
I have updated everything with sudo npm update, here is my package.json
"JSONStream": "^0.10.0",
"async": "^0.9.0",
"codecov.io": "0.0.8",
"commander": "^2.7.1",
"debug": "^2.1.1",
"event-stream": "^3.3.0",
"express": "^4.12.3",
"fs": "0.0.2",
"istanbul": "^0.3.8",
"lru-cache": "^2.6.2",
"mkdirp": "^0.5.0",
"mocha-lcov-reporter": "0.0.2",
"nock": "^1.2.1",
"numeral": "^1.5.3",
"path": "^0.11.14",
"pg": "^4.3.0",
"plotly": "^1.0.2",
"progress": "^1.1.8",
"request": "^2.53.0",
"should": "^5.2.0"
Any idea ?