Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Node.js compatibility

Enabling Node.js API support in Cloudflare Workers by configuring the nodejscompat compatibility flag and setting the appropriate compatibility date in Wrangler.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Node.js compatibility

Enabling Node.js API support in Cloudflare Workers by configuring the nodejscompat compatibility flag and setting the appropriate compatibility date in Wrangler.

When To Use

Use when you need to import npm packages that rely on Node.js runtime APIs into a Cloudflare Worker environment.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-runtime-apis-nodejs-node-js-compatibility-workflow-guide.mdA guide explaining how to use Node.js API polyfills and compatibility flags within Cloudflare Workers.Questions about a guide explaining how to use Node.js API polyfills and compatibility flags within Cloudflare Workers.
examples/workers-runtime-apis-nodejs-node-js-compatibility-cloudflare-workers-nod.textA configuration snippet showing how to enable the nodejscompat compatibility flag and set a compatibility date in a wrangler configuration.Exact payloads, commands, or snippets shown in A configuration snippet showing how to enable the nodejscompat compatibility flag and set a compatibility date in a w...
examples/workers-runtime-apis-nodejs-node-js-compatibility-cloudflare-workers-nod-2.textA configuration snippet demonstrating how to enable Node.js compatibility using compatibility_flags and compatibility_date in a wrangler configuration.Exact payloads, commands, or snippets shown in A configuration snippet demonstrating how to enable Node.js compatibility using compatibilityflags and compatibilityd...
examples/workers-runtime-apis-nodejs-node-js-compatibility-cloudflare-workers-nod-3.textA text report indicating which Node.js APIs are currently not implemented in the Cloudflare Workers runtime via unenv.Exact payloads, commands, or snippets shown in A text report indicating which Node.js APIs are currently not implemented in the Cloudflare Workers runtime via unenv.
examples/workers-runtime-apis-nodejs-node-js-compatibility-cloudflare-workers-nod-4.textA configuration snippet demonstrating the use of compatibility flags to enable Node.js APIs in Cloudflare Workers.Exact payloads, commands, or snippets shown in A configuration snippet demonstrating the use of compatibility flags to enable Node.js APIs in Cloudflare Workers.
examples/workers-runtime-apis-nodejs-node-js-compatibility-cloudflare-workers-nod-5.textA configuration snippet demonstrating how to enable Node.js compatibility flags in a Cloudflare Workers environment.Exact payloads, commands, or snippets shown in A configuration snippet demonstrating how to enable Node.js compatibility flags in a Cloudflare Workers environment.

What This Skill Covers

  • When you write a Worker, you may need to import packages from npm ↗. Many npm packages rely on APIs from the Node.js runtime ↗, and will not work unless thes...
  • Main sections: Get Started, Supported Node.js APIs, Node.js API Polyfills, Enable only AsyncLocalStorage.

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/runtime-apis/nodejs