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.
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
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-runtime-apis-nodejs-fs-workflow-guide.md | Documentation 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.text | A 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.text | A 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.text | A 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.text | A 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
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - 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
