rx-node writeToStream not emitting output to process.stdout

161 views Asked by At

I have been using the node extensions for RX (rx-node) and am having trouble using a particular function, writeToStream.

The following example does not emit any values to the console (process.stdout):

var Rx = require('rx');
var RxNode = require('rx-node');
var source = Rx.Observable.range(0, 5);
var subscription = RxNode.writeToStream(source, process.stdout, 'utf8');

I have tried using an alternative using a simple subscriptions which works fine (I write the output from "next" directly to the console) but that is a work-around to getting the writeToStream working.

Any ideas what I amy need to do to get the writeToStream working? Any help is appreciated.

1

There are 1 answers

1
paulpdaniels On BEST ANSWER

This issue is a bug in the 1.0 version of rx-node. It has been fixed in the latest versions. However these fixes are not yet on npm, the best fix right now is to download the master source directly (it's just one file).

Update 1 The fix is now live on npm as of version 1.0.1