StaticTextFile
The StaticTextFile resource creates and manages plain text files in the filesystem using Alchemy’s File System capabilities.
Minimal Example
Section titled “Minimal Example”Creates a simple text file with content:
import { StaticTextFile } from "alchemy/fs";
const readme = await StaticTextFile( "README.md", "# Project Name\n\nProject description goes here.");
Custom Path
Section titled “Custom Path”Creates a text file at a specific path:
import { StaticTextFile } from "alchemy/fs";
const changelog = await StaticTextFile( "CHANGELOG.md", "docs/CHANGELOG.md", "# Changelog\n\n## v1.0.0\n\n- Initial release");
Nested Directory
Section titled “Nested Directory”Creates a text file in a nested directory structure (directories are created automatically):
import { StaticTextFile } from "alchemy/fs";
const log = await StaticTextFile( "app.log", "logs/app/app.log", "Application started successfully");