Runtime Guides
Node Runtime
Use sharp-backed encoding for local paths, remote URLs, batching, cache, and manifests.
When to use
Section titled “When to use”Use blurkit/node for build steps, CMS import jobs, server-side processing, and manifest generation.
Example
Section titled “Example”import { createFilesystemCache, encode } from 'blurkit/node'
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(NodeBufferworks directly, including views with a non-zero byte offset)
- Requires
sharp>=0.34.5 <0.36.0at execution time. - Additional Node exports:
encodeMany()encodeManySettled()createMemoryCache()createFilesystemCache()createManifest()writeManifest()
Limits / Caveats
Section titled “Limits / Caveats”- Requires
sharp. - Missing
sharpthrowsBLURKIT_MISSING_SHARPwith install guidance. encodeMany()is fail-fast.