miniflare
4.20260730.0 · 30 Jul 2026MIT57.5M / weekRepositoryHomepagenpmAtom feed
3.20250718.3 is the newest release of 3.x.
In short
2 new1 fixed1 internal
Release note
Minor Changes
Customisable unsafe direct sockets entrypoints
Previously, Miniflare provided experimental
unsafeDirectHostandunsafeDirectPortoptions for starting an HTTP server that pointed directly to a specific Worker. This change replaces these options with a singleunsafeDirectSocketsoption that accepts an array of socket objects of the form{ host?: string, port?: number, entrypoint?: string, proxy?: boolean }.hostdefaults to127.0.0.1,portdefaults to0,entrypointdefaults todefault, andproxydefaults tofalse. This allows you to start HTTP servers for specific entrypoints of specific Workers.proxycontrols theStyleof the socket.Note these sockets set the
capnpConnectHostworkerdoption to"miniflare-unsafe-internal-capnp-connect".externalserviceBindingswill set theircapnpConnectHostoption to the same value allowing RPC over multipleMiniflareinstances. Refer to #1757 for more information.Support named entrypoints for
serviceBindingsThis change allows service bindings to bind to a named export of another Worker using designators of the form
{ name: string | typeof kCurrentWorker, entrypoint?: string }. Previously, you could only bind to thedefaultentrypoint. With this change, you can bind to any exported entrypoint.import { kCurrentWorker, Miniflare } from "miniflare"; const mf = new Miniflare({ workers: [ { name: "a", serviceBindings: { A_RPC_SERVICE: { name: kCurrentWorker, entrypoint: "RpcEntrypoint" }, A_NAMED_SERVICE: { name: "a", entrypoint: "namedEntrypoint" }, B_NAMED_SERVICE: { name: "b", entrypoint: "anotherNamedEntrypoint" }, }, compatibilityFlags: ["rpc"], modules: true, script: ` import { WorkerEntrypoint } from "cloudflare:workers"; export class RpcEntrypoint extends WorkerEntrypoint { ping() { return "a:rpc:pong"; } } export const namedEntrypoint = { fetch(request, env, ctx) { return new Response("a:named:pong"); } }; ... `, }, { name: "b", modules: true, script: ` export const anotherNamedEntrypoint = { fetch(request, env, ctx) { return new Response("b:named:pong"); } }; `, }, ], });
Patch Changes
Allow
scripts withoutscriptPaths to import built-in modulesPreviously, if a string
scriptoption was specified withmodules: truebut without a correspondingscriptPath, allimports were forbidden. This change relaxes that restriction to allow imports of built-innode:*,cloudflare:*andworkerd:*modules without ascriptPath.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.