Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Get Started

Teaches how to install, initialize, and configure the Miniflare API to simulate Cloudflare Workers environments, dispatch events, and manage local storage emulations for testing.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Get Started

Teaches how to install, initialize, and configure the Miniflare API to simulate Cloudflare Workers environments, dispatch events, and manage local storage emulations for testing.

When To Use

Use when you need to set up a local testing environment to dispatch fetch or scheduled events to Workers and simulate connections to KV, R2, or Durable Objects.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-testing-miniflare-get-started-workflow-guide.mdA guide covering the installation, usage, and configuration of the Miniflare API for testing Cloudflare Workers locally.Questions about a guide covering the installation, usage, and configuration of the Miniflare API for testing Cloudflare Workers locally.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-insta.textThe npm installation command required to add miniflare as a development dependency for testing Cloudflare Workers.Exact payloads, commands, or snippets shown in The npm installation command required to add miniflare as a development dependency for testing Cloudflare Workers.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-insta-2.textThe yarn command used to add miniflare as a development dependency for testing Cloudflare Workers.Exact payloads, commands, or snippets shown in The yarn command used to add miniflare as a development dependency for testing Cloudflare Workers.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-insta-3.textThe pnpm command used to add miniflare as a development dependency for testing Cloudflare Workers.Exact payloads, commands, or snippets shown in The pnpm command used to add miniflare as a development dependency for testing Cloudflare Workers.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-bun-i.textThe shell command to install Miniflare as a development dependency using the Bun package manager.Exact payloads, commands, or snippets shown in The shell command to install Miniflare as a development dependency using the Bun package manager.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-get-s.textA basic configuration and code structure for initializing a Miniflare development environment for Cloudflare Workers.Exact payloads, commands, or snippets shown in A basic configuration and code structure for initializing a Miniflare development environment for Cloudflare Workers.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-get-s-2.textA JavaScript code example demonstrating how to initialize and dispatch a fetch request using the Miniflare local development server.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to initialize and dispatch a fetch request using the Miniflare local deve...
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-javas.textA JavaScript code snippet demonstrating how to initialize a new Miniflare instance with a script path.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to initialize a new Miniflare instance with a script path.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-dispo.textA code snippet demonstrating the use of the await mf.dispose() method within a Miniflare testing environment.Exact payloads, commands, or snippets shown in A code snippet demonstrating the use of the await mf.dispose() method within a Miniflare testing environment.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-javas-2.textA JavaScript code snippet demonstrating how to instantiate and configure a Miniflare instance with script bindings and KV namespaces.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to instantiate and configure a Miniflare instance with script bindings an...
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-javas-3.textA JavaScript code example demonstrating how to initialize and configure a Miniflare instance for testing Cloudflare Workers locally.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to initialize and configure a Miniflare instance for testing Cloudflare W...
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-javas-4.textA JavaScript code snippet demonstrating how to initialize and run a Miniflare instance for testing Cloudflare Workers locally.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to initialize and run a Miniflare instance for testing Cloudflare Workers...
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-javas-5.textA JavaScript code snippet demonstrating how to instantiate a new Miniflare instance with configuration options.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to instantiate a new Miniflare instance with configuration options.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-javas-6.textA JavaScript code snippet demonstrating how to instantiate a new Miniflare instance with configuration options.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to instantiate a new Miniflare instance with configuration options.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-dev-e.textConfiguration of environment variables to disable cf fetching and specify custom cache locations when running wrangler dev with Miniflare.Exact payloads, commands, or snippets shown in Configuration of environment variables to disable cf fetching and specify custom cache locations when running wrangle...
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-javas-7.textA JavaScript code snippet demonstrating how to instantiate a new Miniflare instance with HTTPS enabled.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to instantiate a new Miniflare instance with HTTPS enabled.
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-javas-8.textA JavaScript code snippet demonstrating how to instantiate a new Miniflare instance with optional HTTPS configuration options.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to instantiate a new Miniflare instance with optional HTTPS configuration...
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-initi.textA JavaScript code snippet demonstrating how to instantiate a Miniflare instance with optional HTTPS key and certificate configurations.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to instantiate a Miniflare instance with optional HTTPS key and certifica...
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-javas-9.textA JavaScript code snippet demonstrating how to instantiate the Miniflare class with script paths and debug logging enabled.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to instantiate the Miniflare class with script paths and debug logging en...
examples/workers-testing-miniflare-get-started-cloudflare-workers-miniflare-javas-10.textA JavaScript code example demonstrating how to initialize and configure a Miniflare instance with logging, script paths, and module support.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to initialize and configure a Miniflare instance with logging, script pat...

What This Skill Covers

  • The Miniflare API allows you to dispatch events to workers without making actual HTTP requests, simulate connections between Workers, and interact with local...
  • Main sections: Installation, Usage, String and File Scripts, Watching, Reloading and Disposing, Updating Options and the Global Scope.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/testing/miniflare/get-started