Readme

Set Blob Storage via fetch Response body

Inspired by Wes Bos's tweet about Bun's elegant Filesystem API.

1
2
3
4
5
6
import { blob } from "https://esm.town/v/std/blob?v=12";
const url = "https://example.com";
const key = "exampleBlob";
await blob.set(key, (await fetch(url)).body);
console.log(await (await blob.get(key)).text());
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.