mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
Fixes #21189 `.pause()` should unref but it should still continue to emit `readable` events (although it should not send `data` events) also stdin.unref() should not pause input, it should only prevent stdin from keeping the process alive. DRAFT: - [x] ~~this causes a bug where `process.stdin.on("readable", () => {}); process.stdin.pause()` will allow the process to exit when it shouldn't.~~ fixed --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
12 lines
244 B
JavaScript
12 lines
244 B
JavaScript
console.log("%READY%");
|
|
|
|
const r = () => {
|
|
let chunk;
|
|
while ((chunk = process.stdin.read()) !== null) {
|
|
console.log("got readable", JSON.stringify(chunk.toString()));
|
|
console.log("%READY%");
|
|
}
|
|
};
|
|
|
|
process.stdin.on("readable", r);
|