
Public
Like
blob-storage
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v27View latest version
This val pairs the lowdb lib with val.town built-in blob storage.
Usage:
import { blobStorage } from "./main.ts";
const storage = await blobStorage(
{ posts: [] } as { posts: string[] } // default data, used for types
]);
// use the update method to mutage the data
await storage.update(({ posts }) => {
posts.push("Hello");
});
// use the `data` attribute to read
console.log(storage.data.posts)