mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 04:18:58 +00:00
11 lines
348 B
JavaScript
11 lines
348 B
JavaScript
export const arrayBuffer = Bun.readableStreamToArrayBuffer;
|
|
export const text = Bun.readableStreamToText;
|
|
export const json = (stream) =>
|
|
Bun.readableStreamToText(stream).then(JSON.parse);
|
|
|
|
export const buffer = async (readableStream) => {
|
|
return new Buffer(await arrayBuffer(readableStream));
|
|
};
|
|
|
|
export const blob = Bun.readableStreamToBlob;
|