StaticYamlFile
The StaticYamlFile resource creates YAML files with formatted content using the YAML format.
Minimal Example
Section titled “Minimal Example”Creates a simple YAML configuration file.
import { StaticYamlFile } from "alchemy/fs";
const config = await StaticYamlFile("config.yaml", { server: { host: "localhost", port: 3000, },});
Nested Configuration
Section titled “Nested Configuration”Creates a YAML file with nested configuration objects.
import { StaticYamlFile } from "alchemy/fs";
const config = await StaticYamlFile("config.yaml", { server: { host: "localhost", port: 3000, }, database: { url: "postgresql://localhost:5432/db", pool: { min: 1, max: 10, }, },});
Custom Path
Section titled “Custom Path”Creates a YAML file at a specific path.
import { StaticYamlFile } from "alchemy/fs";
const config = await StaticYamlFile("config", "config/app.yaml", { environment: "production", features: ["auth", "api", "storage"],});