mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
* node:child_process: support defining extra pipes * unneeded * lazily load node:fs * use $isJSArray instead of ArrayIsArray * remove std.log call * don't close child fd we don't own * close child fd's in parent * add Subprocess.stdio getter that aligns with ChildProcess.stdio fd's * [autofix.ci] apply automated fixes * use ArrayList instead of BoundedArray for stdio_pipes * fix stream primordials * dont use unreachable for syscalls * this file was testing Bun.spawn not child_process.spawn * skip ipc for now * ensure the socketpair is created non-blocking on non-mac posix * allow creating a node:net.Socket from an fd via node:net.connect * node:stream tidy * node:child_process: use net.Socket for stdio instead of fs streams * try again * fix Socket eager loading --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
17 lines
282 B
JavaScript
17 lines
282 B
JavaScript
import { sleep } from "bun";
|
|
|
|
const fs = require("node:fs");
|
|
|
|
const stream = fs.createReadStream(null, { fd: 3 });
|
|
var have_read = false;
|
|
|
|
stream.on("ready", () => {
|
|
console.log(stream.read());
|
|
have_read = true;
|
|
});
|
|
|
|
while (true) {
|
|
await sleep(250);
|
|
if (have_read) break;
|
|
}
|