Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers fs

Enabling and using the Node.js fs module in Cloudflare Workers to interact with a memory-based virtual file system including read-only bundle files, a writable /tmp directory, and character devices.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers fs

Enabling and using the Node.js fs module in Cloudflare Workers to interact with a memory-based virtual file system including read-only bundle files, a writable /tmp directory, and character devices.

When To Use

Use when you need to read configuration files from your worker bundle, write temporary files to a /tmp directory, or access character devices like /dev/null in a Cloudflare Workers environment.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-runtime-apis-nodejs-fs-workflow-guide.mdDocumentation explaining how to enable Node.js fs API polyfills in Cloudflare Workers using the nodejs_compat compatibility flag.Questions about documentation explaining how to enable Node.js fs API polyfills in Cloudflare Workers using the nodejscompat compatib...
examples/workers-runtime-apis-nodejs-fs-cloudflare-workers-nodejs-fs-usage.textA text example demonstrating the use of readFileSync and writeFileSync from the node:fs module within a Cloudflare Workers environment.Exact payloads, commands, or snippets shown in A text example demonstrating the use of readFileSync and writeFileSync from the node:fs module within a Cloudflare Wo...
examples/workers-runtime-apis-nodejs-fs-cloudflare-workers-nodejs-fs-directory-st.textA text representation of the available file system directories and special device files within the Cloudflare Workers runtime environment.Exact payloads, commands, or snippets shown in A text representation of the available file system directories and special device files within the Cloudflare Workers...
examples/workers-runtime-apis-nodejs-fs-cloudflare-workers-nodejs-fs-readfilesync.textA JavaScript code example demonstrating how to use the node:fs module to read a bundled file within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the node:fs module to read a bundled file within a Cloudflare Worker.
examples/workers-runtime-apis-nodejs-fs-cloudflare-workers-nodejs-fs-write-and-re.textA JavaScript example demonstrating how to use the node:fs module to write to and read from the /tmp directory within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to use the node:fs module to write to and read from the /tmp directory within...

What This Skill Covers

  • To enable built-in Node.js APIs and polyfills, add the nodejs\compat compatibility flag to your Wrangler configuration file. This also enables nodejs\compat...

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/fs