stdout-stream

Non-blocking stdout stream

MIT 12 个版本
安装
npm install stdout-stream
yarn add stdout-stream
pnpm add stdout-stream
bun add stdout-stream
README

stdout-stream

Non-blocking stdout stream

npm install stdout-stream

build status dat

Rant

Try saving this example as example.js

console.error('start');
process.stdout.write(new Buffer(1024*1024));
console.error('end');

And run the following program

node example.js | sleep 1000

The program will never print end since stdout in node currently is blocking - even when its being piped (!).

stdout-stream tries to fix this by being a stream that writes to stdout but never blocks

Usage

var stdout = require('stdout-stream');

stdout.write('hello\n'); // write should NEVER block
stdout.write('non-blocking\n')
stdout.write('world\n');

stdout-stream should behave in the same way as process.stdout (i.e. do not end on pipe etc)

License

MIT

版本列表
2.0.0 2022-08-09
1.4.1 2018-08-24
1.4.0 2015-06-23
1.3.0 2014-08-27
1.2.0 2014-04-19
1.1.0 2014-04-18
1.0.5 2014-04-18
1.0.4 2014-04-18
1.0.3 2014-04-17
1.0.2 2014-04-17
1.0.1 2014-04-17
1.0.0 2014-04-17