Global Key-Value Store.beta


gokv will treat uploaded files as images when the Content-Type starts with image/ (exclude svg), then store, resize, and optimize images at scale.

import gokv from "";

const fs = gokv.FileStorage();
const image = new File(
  [await Deno.readFile("./image.png")],
  { type: "image/png" },
const { url } = await fs.upload(image); // url ->

Resizing uploaded images

Your uploaded images will be resized in 1920x1080 boundary by default. You can resize them with gokv resizing presets:

  • (Default, resizng by 1920x1080 boundary)
  • (Resizng by 3840x2160 boundary)
  • (Resizng by 1024x1024 boundary)
  • (Resizng by 512x512 boundary)
  • (Resizng by 256x256 boundary)
  • (Resizng by 128x128 boundary)
  • (Resizng by 64x64 boundary)

Image will be shrunk in size to fully fit within the given width or height, but won’t be enlarged.

Optimize images automatically delivers images with modern image format if the Accept header from the browser includes AVIF or WebP which is significantly smaller.

Accept: image/avif,image/webp,image/*,*/*;q=0.8