mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
24 lines
551 B
JavaScript
24 lines
551 B
JavaScript
import { ArrayBufferSink } from "bun";
|
|
|
|
const sink = new ArrayBufferSink();
|
|
|
|
sink.write("hello");
|
|
sink.write(" ");
|
|
sink.write("world");
|
|
sink.write(new TextEncoder().encode("hello again|"));
|
|
sink.write(
|
|
new TextEncoder().encode(
|
|
"😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
|
|
),
|
|
);
|
|
|
|
const string = Buffer.from(sink.end()).toString().repeat(9999);
|
|
|
|
if (process.env.TEST_STDIO_STRING) {
|
|
const result = string;
|
|
process.stdout.write(result);
|
|
} else {
|
|
const result = Buffer.from(string);
|
|
process.stdout.write(result);
|
|
}
|