aboutsummaryrefslogtreecommitdiff
path: root/bench/stream-file-upload-client/stream-file-bun.js
blob: e3499bd2900c920a3d4c10e70e78e42e0d08c831 (plain) (blame)
1
2
3
4
5
6
7
8
9
import { file } from "bun";
console.time("stream-file-bun");
const response = await fetch(process.env.URL ?? "http://localhost:3000", {
  method: "POST",
  body: file(process.env.FILE ?? "hello.txt"),
});
console.timeEnd("stream-file-bun");

console.log("Sent", await response.text(), "bytes");