aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/stdin-repro.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-25 00:08:36 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-25 00:08:36 -0800
commitd1a4f4fd6981a06920adb632dde2562b76ddc4d0 (patch)
tree6a26cd3ebd8afdbad653a800d54967c4e84b55c2 /test/bun.js/stdin-repro.js
parent0b915fed034c38ae9a2e15caee94530910dc864b (diff)
downloadbun-d1a4f4fd6981a06920adb632dde2562b76ddc4d0.tar.gz
bun-d1a4f4fd6981a06920adb632dde2562b76ddc4d0.tar.zst
bun-d1a4f4fd6981a06920adb632dde2562b76ddc4d0.zip
Introduce `FileSink.ref()` and `FileSink.unref()`
Diffstat (limited to 'test/bun.js/stdin-repro.js')
-rw-r--r--test/bun.js/stdin-repro.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/bun.js/stdin-repro.js b/test/bun.js/stdin-repro.js
index 05daf0637..5f945be7c 100644
--- a/test/bun.js/stdin-repro.js
+++ b/test/bun.js/stdin-repro.js
@@ -1,5 +1,7 @@
-while (true) {
- for await (let chunk of Bun.stdin.stream()) {
- console.log(new Buffer(chunk).toString());
- }
+var count = 5;
+for await (let chunk of Bun.stdin.stream()) {
+ const str = new Buffer(chunk).toString();
+ console.error("how many?", count, chunk.byteLength);
+ count -= str.split("\n").length;
+ console.log(str);
}