mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
17 lines
446 B
JavaScript
17 lines
446 B
JavaScript
function handleReadable() {
|
|
let chunk;
|
|
while ((chunk = process.stdin.read()) !== null) {
|
|
console.log(JSON.stringify(chunk.toString("utf-8")));
|
|
process.exit(0);
|
|
}
|
|
}
|
|
process.stdin.addListener("readable", handleReadable);
|
|
process.stdin.ref();
|
|
process.stdin.unref();
|
|
await new Promise(r => setImmediate(r));
|
|
process.stdin.ref();
|
|
await new Promise(r => setImmediate(r));
|
|
process.stdin.unref();
|
|
process.stdin.ref();
|
|
console.log("ready");
|