Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/workerd/README.md
1# Workerd Runtime23V8-based JS/Wasm runtime powering Cloudflare Workers. Use as app server, dev tool, or HTTP proxy.45## ⚠️ IMPORTANT SECURITY NOTICE6**workerd is NOT a hardened sandbox.** Do not run untrusted code. It's designed for deploying YOUR code locally/self-hosted, not multi-tenant SaaS. Cloudflare production adds security layers not present in open-source workerd.78## Decision Tree: When to Use What910**95% of users:** Use Wrangler11- Local development: `wrangler dev` (uses workerd internally)12- Deployment: `wrangler deploy` (deploys to Cloudflare)13- Types: `wrangler types` (generates TypeScript types)1415**Use raw workerd directly only if:**16- Self-hosting Workers runtime in production17- Embedding runtime in C++ application18- Custom tooling/testing infrastructure19- Debugging workerd-specific behavior2021**Never use workerd for:**22- Running untrusted/user-submitted code23- Multi-tenant isolation (not hardened)24- Production without additional security layers2526## Key Features27- **Standards-based**: Fetch API, Web Crypto, Streams, WebSocket28- **Nanoservices**: Service bindings with local call performance29- **Capability security**: Explicit bindings prevent SSRF30- **Backwards compatible**: Version = max compat date supported3132## Architecture33```34Config (workerd.capnp)35├── Services (workers/endpoints)36├── Sockets (HTTP/HTTPS listeners)37└── Extensions (global capabilities)38```3940## Quick Start41```bash42workerd serve config.capnp43workerd compile config.capnp myConfig -o binary44workerd test config.capnp45```4647## Platform Support & Beta Status4849| Platform | Status | Notes |50|----------|--------|-------|51| Linux (x64) | Stable | Primary platform |52| macOS (x64/ARM) | Stable | Full support |53| Windows | Beta | Use WSL2 for best results |54| Linux (ARM64) | Experimental | Limited testing |5556workerd is in **active development**. Breaking changes possible. Pin versions in production.5758## Core Concepts59- **Service**: Named endpoint (worker/network/disk/external)60- **Binding**: Capability-based resource access (KV/DO/R2/services)61- **Compatibility date**: Feature gate (always set!)62- **Modules**: ES modules (recommended) or service worker syntax6364## Reading Order (Progressive Disclosure)6566**Start here:**671. This README (overview, decision tree)682. [patterns.md](./patterns.md) - Common workflows, framework examples6970**When you need details:**713. [configuration.md](./configuration.md) - Config format, services, bindings724. [api.md](./api.md) - Runtime APIs, TypeScript types735. [gotchas.md](./gotchas.md) - Common errors, debugging7475## Related References76- [workers](../workers/) - Workers runtime API documentation77- [miniflare](../miniflare/) - Testing tool built on workerd78- [wrangler](../wrangler/) - CLI that uses workerd for local dev79