Skip to main content
cf-common

Typed TypeScript wrappers and helpers for Cloudflare bindings and APIs — one tree-shakeable module per service.

worker.ts
import { getBinding } from '@rtorcato/cf-common/env'
import { kv } from '@rtorcato/cf-common/kv'

export default {
  async fetch(req, env) {
    const store = kv(getBinding(env, 'CACHE'))
    const hit = await store.getJSON<User>('u:42')
    return Response.json(hit ?? { id: 42 })
  },
}
npm install @rtorcato/cf-common
Typed end-to-end
Typed end-to-end
Strict types over every binding — no `any` at the edges.
Tree-shakeable
Tree-shakeable
Named subpath exports — ship only the service you import.
Thin, not a framework
Thin, not a framework
A convenience layer over Cloudflare, never a wrapper you fight.
Zero required deps
Zero required deps
Pure helpers over the Workers runtime APIs you already have.

One module per Cloudflare service

Each lands as a typed, tree-shakeable subpath. See the roadmap for status.

Sibling projects

More from @rtorcato — same conventions, same release pipeline.