3 Non-blocking stdout stream
5 npm install stdout-stream
7 [![build status](http://img.shields.io/travis/mafintosh/level-filesystem.svg?style=flat)](http://travis-ci.org/mafintosh/stdout-stream)
8 ![dat](http://img.shields.io/badge/Development%20sponsored%20by-dat-green.svg?style=flat)
13 Try saving this example as `example.js`
16 console.error('start');
17 process.stdout.write(new Buffer(1024*1024));
21 And run the following program
24 node example.js | sleep 1000
27 The program will never print `end` since stdout in node currently is blocking - even when its being piped (!).
29 stdout-stream tries to fix this by being a stream that writes to stdout but never blocks
34 var stdout = require('stdout-stream');
36 stdout.write('hello\n'); // write should NEVER block
37 stdout.write('non-blocking\n')
38 stdout.write('world\n');
41 `stdout-stream` should behave in the same way as `process.stdout` (i.e. do not end on pipe etc)