// @runtime node, bun, deno import { bench, run } from "./runner.mjs"; import { Buffer } from "node:buffer"; import { openSync } from "node:fs"; import { writeFile } from "node:fs/promises"; import { writeSync as write } from "node:fs"; bench("writeFile(/tmp/foo.txt, short string)", async () => { await writeFile("/tmp/foo.txt", "short string", "utf8"); }); const buffer = Buffer.from("short string"); bench("writeFile(/tmp/foo.txt, Buffer.from(short string))", async () => { await writeFile("/tmp/foo.txt", buffer); }); const fd = openSync("/tmp/foo.txt", "w"); bench("write(fd, short string)", () => { const bytesWritten = write(fd, "short string", "utf8"); if (bytesWritten !== 12) throw new Error("wrote !== 12"); }); bench("write(fd, Uint8Array(short string))", () => { const bytesWritten = write(fd, buffer); if (bytesWritten !== 12) throw new Error("wrote !== 12"); }); await run(); tion value='bun-crash-dump'>bun-crash-dump Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/examples/macros/example.js (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2023-08-19fix minified "\n".lengthGravatar dave caruso 2-4/+4
2023-08-19Add inline sourcemaps when `--inspect` is enabled (#4213)Gravatar Jarred Sumner 3-3/+64
* Add inline sourcemaps when --inspect is enabled * Add some assertions * Update javascript.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-19tty `ReadStream`, `WriteStream`, and readline rawmode (#4179)Gravatar Dylan Conway 23-722/+821
* tty `WriteStream`, `ReadStream`, and rawmode * tests * refactor prototypes * fix failing test * fix test and library usage * more merge * fix child_process test * create pseudo terminal for tty tests * match node logic * handle invalid tty * close descriptors * move tests to another process * fix test again * fix test on linux
2023-08-18Fix make headers (again)Gravatar Jarred Sumner 1-0/+2