Skip to content

Runtime Guides

Deno Runtime

Use wasm-backed encoding with local file support and OffscreenCanvas rendering for Deno.

Use blurkit/deno for Deno scripts, build steps, and server-side processing when you want local filesystem support without depending on sharp.

import { createFilesystemCache, encode } from 'blurkit/deno'
const cache = createFilesystemCache({
dir: './.cache/blurkit',
ttlMs: 300_000,
})
const result = await encode('./public/hero.jpg', {
size: 32,
cache,
})
  • Supported inputs:
    • local path string
    • remote http/https URL string
    • URL
    • Blob
    • ArrayBuffer
    • Uint8Array
  • Image decoding uses blurkit-wasm-codecs (PNG, JPEG, WebP only).
  • DataURL rendering uses native OffscreenCanvas when a 2D context is available, otherwise falls back to wasm rendering (Deno’s built-in OffscreenCanvas is WebGPU-only and triggers the fallback).
  • Does not require sharp.
  • Additional Deno exports:
    • encodeMany()
    • encodeManySettled()
    • createMemoryCache()
    • createFilesystemCache()
    • createManifest()
    • writeManifest()
  • Requires blurkit-wasm-codecs at execution time.
  • Missing wasm codecs throws BLURKIT_MISSING_WASM_CODECS with install guidance.
  • Decode support is limited to PNG, JPEG, and WebP.
  • encodeMany() is fail-fast.