Runtime Guides
Deno Runtime
Use wasm-backed encoding with local file support and OffscreenCanvas rendering for Deno.
- entrypoint
- blurkit/deno
- backend
- wasm codecs
- install
- blurkit-wasm-codecs
Why this runtime
Use blurkit/deno for Deno scripts, build steps, and server-side processing when you want local filesystem support without depending on sharp.
Encode with a filesystem cache
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,})Inputs and rendering
- Supported inputs:
- local path string
- remote
http/httpsURL string URLBlobArrayBufferUint8Array
- Image decoding uses
blurkit-wasm-codecs(PNG, JPEG, WebP only). - DataURL rendering uses native
OffscreenCanvaswhen a 2D context is available, otherwise falls back to wasm rendering (Deno’s built-inOffscreenCanvasis WebGPU-only and triggers the fallback). - Does not require
sharp. - Additional Deno exports:
encodeMany()encodeManySettled()createMemoryCache()createFilesystemCache()createManifest()writeManifest()
Runtime notes
- Requires
blurkit-wasm-codecsat execution time. - Missing wasm codecs throws
BLURKIT_MISSING_WASM_CODECSwith install guidance. - Decode support is limited to PNG, JPEG, and WebP.
encodeMany()is fail-fast.