Runtime Guides
Deno Runtime
Use wasm-backed encoding with local file support and OffscreenCanvas rendering for Deno.
When to use
Section titled “When to use”Use blurkit/deno for Deno scripts, build steps, and server-side processing when you want local filesystem support without depending on sharp.
Example
Section titled “Example”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 / Options / Behavior
Section titled “Inputs / Options / Behavior”- 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()
Limits / Caveats
Section titled “Limits / Caveats”- 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.